"use strict";
(() => {
  var __create = Object.create;
  var __defProp = Object.defineProperty;
  var __defProps = Object.defineProperties;
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
  var __getOwnPropNames = Object.getOwnPropertyNames;
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
  var __getProtoOf = Object.getPrototypeOf;
  var __hasOwnProp = Object.prototype.hasOwnProperty;
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
  var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
  var __spreadValues = (a, b) => {
    for (var prop in b ||= {})
      if (__hasOwnProp.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    if (__getOwnPropSymbols)
      for (var prop of __getOwnPropSymbols(b)) {
        if (__propIsEnum.call(b, prop))
          __defNormalProp(a, prop, b[prop]);
      }
    return a;
  };
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
  var __commonJS = (cb, mod) => function __require() {
    return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  };
  var __copyProps = (to, from, except, desc) => {
    if (from && typeof from === "object" || typeof from === "function") {
      for (let key2 of __getOwnPropNames(from))
        if (!__hasOwnProp.call(to, key2) && key2 !== except)
          __defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
    }
    return to;
  };
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
    isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
    mod
  ));

  // node_modules/object-assign/index.js
  var require_object_assign = __commonJS({
    "node_modules/object-assign/index.js"(exports, module) {
      "use strict";
      var getOwnPropertySymbols = Object.getOwnPropertySymbols;
      var hasOwnProperty = Object.prototype.hasOwnProperty;
      var propIsEnumerable = Object.prototype.propertyIsEnumerable;
      function toObject(val) {
        if (val === null || val === void 0) {
          throw new TypeError("Object.assign cannot be called with null or undefined");
        }
        return Object(val);
      }
      function shouldUseNative() {
        try {
          if (!Object.assign) {
            return false;
          }
          var test1 = new String("abc");
          test1[5] = "de";
          if (Object.getOwnPropertyNames(test1)[0] === "5") {
            return false;
          }
          var test2 = {};
          for (var i = 0; i < 10; i++) {
            test2["_" + String.fromCharCode(i)] = i;
          }
          var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
            return test2[n];
          });
          if (order2.join("") !== "0123456789") {
            return false;
          }
          var test3 = {};
          "abcdefghijklmnopqrst".split("").forEach(function(letter) {
            test3[letter] = letter;
          });
          if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
            return false;
          }
          return true;
        } catch (err) {
          return false;
        }
      }
      module.exports = shouldUseNative() ? Object.assign : function(target, source) {
        var from;
        var to = toObject(target);
        var symbols;
        for (var s = 1; s < arguments.length; s++) {
          from = Object(arguments[s]);
          for (var key2 in from) {
            if (hasOwnProperty.call(from, key2)) {
              to[key2] = from[key2];
            }
          }
          if (getOwnPropertySymbols) {
            symbols = getOwnPropertySymbols(from);
            for (var i = 0; i < symbols.length; i++) {
              if (propIsEnumerable.call(from, symbols[i])) {
                to[symbols[i]] = from[symbols[i]];
              }
            }
          }
        }
        return to;
      };
    }
  });

  // node_modules/react/cjs/react.development.js
  var require_react_development = __commonJS({
    "node_modules/react/cjs/react.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          var _assign = require_object_assign();
          var ReactVersion = "17.0.2";
          var REACT_ELEMENT_TYPE = 60103;
          var REACT_PORTAL_TYPE = 60106;
          exports.Fragment = 60107;
          exports.StrictMode = 60108;
          exports.Profiler = 60114;
          var REACT_PROVIDER_TYPE = 60109;
          var REACT_CONTEXT_TYPE = 60110;
          var REACT_FORWARD_REF_TYPE = 60112;
          exports.Suspense = 60113;
          var REACT_SUSPENSE_LIST_TYPE = 60120;
          var REACT_MEMO_TYPE = 60115;
          var REACT_LAZY_TYPE = 60116;
          var REACT_BLOCK_TYPE = 60121;
          var REACT_SERVER_BLOCK_TYPE = 60122;
          var REACT_FUNDAMENTAL_TYPE = 60117;
          var REACT_SCOPE_TYPE = 60119;
          var REACT_OPAQUE_ID_TYPE = 60128;
          var REACT_DEBUG_TRACING_MODE_TYPE = 60129;
          var REACT_OFFSCREEN_TYPE = 60130;
          var REACT_LEGACY_HIDDEN_TYPE = 60131;
          if (typeof Symbol === "function" && Symbol.for) {
            var symbolFor = Symbol.for;
            REACT_ELEMENT_TYPE = symbolFor("react.element");
            REACT_PORTAL_TYPE = symbolFor("react.portal");
            exports.Fragment = symbolFor("react.fragment");
            exports.StrictMode = symbolFor("react.strict_mode");
            exports.Profiler = symbolFor("react.profiler");
            REACT_PROVIDER_TYPE = symbolFor("react.provider");
            REACT_CONTEXT_TYPE = symbolFor("react.context");
            REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref");
            exports.Suspense = symbolFor("react.suspense");
            REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list");
            REACT_MEMO_TYPE = symbolFor("react.memo");
            REACT_LAZY_TYPE = symbolFor("react.lazy");
            REACT_BLOCK_TYPE = symbolFor("react.block");
            REACT_SERVER_BLOCK_TYPE = symbolFor("react.server.block");
            REACT_FUNDAMENTAL_TYPE = symbolFor("react.fundamental");
            REACT_SCOPE_TYPE = symbolFor("react.scope");
            REACT_OPAQUE_ID_TYPE = symbolFor("react.opaque.id");
            REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
            REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen");
            REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
          }
          var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
          var FAUX_ITERATOR_SYMBOL = "@@iterator";
          function getIteratorFn(maybeIterable) {
            if (maybeIterable === null || typeof maybeIterable !== "object") {
              return null;
            }
            var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
            if (typeof maybeIterator === "function") {
              return maybeIterator;
            }
            return null;
          }
          var ReactCurrentDispatcher = {
            current: null
          };
          var ReactCurrentBatchConfig = {
            transition: 0
          };
          var ReactCurrentOwner = {
            current: null
          };
          var ReactDebugCurrentFrame = {};
          var currentExtraStackFrame = null;
          function setExtraStackFrame(stack) {
            {
              currentExtraStackFrame = stack;
            }
          }
          {
            ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
              {
                currentExtraStackFrame = stack;
              }
            };
            ReactDebugCurrentFrame.getCurrentStack = null;
            ReactDebugCurrentFrame.getStackAddendum = function() {
              var stack = "";
              if (currentExtraStackFrame) {
                stack += currentExtraStackFrame;
              }
              var impl = ReactDebugCurrentFrame.getCurrentStack;
              if (impl) {
                stack += impl() || "";
              }
              return stack;
            };
          }
          var IsSomeRendererActing = {
            current: false
          };
          var ReactSharedInternals = {
            ReactCurrentDispatcher,
            ReactCurrentBatchConfig,
            ReactCurrentOwner,
            IsSomeRendererActing,
            assign: _assign
          };
          {
            ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
          }
          function warn(format) {
            {
              for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                args[_key - 1] = arguments[_key];
              }
              printWarning("warn", format, args);
            }
          }
          function error(format) {
            {
              for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
                args[_key2 - 1] = arguments[_key2];
              }
              printWarning("error", format, args);
            }
          }
          function printWarning(level, format, args) {
            {
              var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
              var stack = ReactDebugCurrentFrame2.getStackAddendum();
              if (stack !== "") {
                format += "%s";
                args = args.concat([stack]);
              }
              var argsWithFormat = args.map(function(item) {
                return "" + item;
              });
              argsWithFormat.unshift("Warning: " + format);
              Function.prototype.apply.call(console[level], console, argsWithFormat);
            }
          }
          var didWarnStateUpdateForUnmountedComponent = {};
          function warnNoop(publicInstance, callerName) {
            {
              var _constructor = publicInstance.constructor;
              var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass";
              var warningKey = componentName + "." + callerName;
              if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
                return;
              }
              error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName);
              didWarnStateUpdateForUnmountedComponent[warningKey] = true;
            }
          }
          var ReactNoopUpdateQueue = {
            isMounted: function(publicInstance) {
              return false;
            },
            enqueueForceUpdate: function(publicInstance, callback, callerName) {
              warnNoop(publicInstance, "forceUpdate");
            },
            enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
              warnNoop(publicInstance, "replaceState");
            },
            enqueueSetState: function(publicInstance, partialState, callback, callerName) {
              warnNoop(publicInstance, "setState");
            }
          };
          var emptyObject = {};
          {
            Object.freeze(emptyObject);
          }
          function Component2(props, context, updater) {
            this.props = props;
            this.context = context;
            this.refs = emptyObject;
            this.updater = updater || ReactNoopUpdateQueue;
          }
          Component2.prototype.isReactComponent = {};
          Component2.prototype.setState = function(partialState, callback) {
            if (!(typeof partialState === "object" || typeof partialState === "function" || partialState == null)) {
              {
                throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
              }
            }
            this.updater.enqueueSetState(this, partialState, callback, "setState");
          };
          Component2.prototype.forceUpdate = function(callback) {
            this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
          };
          {
            var deprecatedAPIs = {
              isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
              replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
            };
            var defineDeprecationWarning = function(methodName, info) {
              Object.defineProperty(Component2.prototype, methodName, {
                get: function() {
                  warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
                  return void 0;
                }
              });
            };
            for (var fnName in deprecatedAPIs) {
              if (deprecatedAPIs.hasOwnProperty(fnName)) {
                defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
              }
            }
          }
          function ComponentDummy() {
          }
          ComponentDummy.prototype = Component2.prototype;
          function PureComponent(props, context, updater) {
            this.props = props;
            this.context = context;
            this.refs = emptyObject;
            this.updater = updater || ReactNoopUpdateQueue;
          }
          var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
          pureComponentPrototype.constructor = PureComponent;
          _assign(pureComponentPrototype, Component2.prototype);
          pureComponentPrototype.isPureReactComponent = true;
          function createRef() {
            var refObject = {
              current: null
            };
            {
              Object.seal(refObject);
            }
            return refObject;
          }
          function getWrappedName(outerType, innerType, wrapperName) {
            var functionName = innerType.displayName || innerType.name || "";
            return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
          }
          function getContextName(type) {
            return type.displayName || "Context";
          }
          function getComponentName(type) {
            if (type == null) {
              return null;
            }
            {
              if (typeof type.tag === "number") {
                error("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue.");
              }
            }
            if (typeof type === "function") {
              return type.displayName || type.name || null;
            }
            if (typeof type === "string") {
              return type;
            }
            switch (type) {
              case exports.Fragment:
                return "Fragment";
              case REACT_PORTAL_TYPE:
                return "Portal";
              case exports.Profiler:
                return "Profiler";
              case exports.StrictMode:
                return "StrictMode";
              case exports.Suspense:
                return "Suspense";
              case REACT_SUSPENSE_LIST_TYPE:
                return "SuspenseList";
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_CONTEXT_TYPE:
                  var context = type;
                  return getContextName(context) + ".Consumer";
                case REACT_PROVIDER_TYPE:
                  var provider = type;
                  return getContextName(provider._context) + ".Provider";
                case REACT_FORWARD_REF_TYPE:
                  return getWrappedName(type, type.render, "ForwardRef");
                case REACT_MEMO_TYPE:
                  return getComponentName(type.type);
                case REACT_BLOCK_TYPE:
                  return getComponentName(type._render);
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return getComponentName(init(payload));
                  } catch (x) {
                    return null;
                  }
                }
              }
            }
            return null;
          }
          var hasOwnProperty = Object.prototype.hasOwnProperty;
          var RESERVED_PROPS = {
            key: true,
            ref: true,
            __self: true,
            __source: true
          };
          var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
          {
            didWarnAboutStringRefs = {};
          }
          function hasValidRef(config) {
            {
              if (hasOwnProperty.call(config, "ref")) {
                var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
                if (getter && getter.isReactWarning) {
                  return false;
                }
              }
            }
            return config.ref !== void 0;
          }
          function hasValidKey(config) {
            {
              if (hasOwnProperty.call(config, "key")) {
                var getter = Object.getOwnPropertyDescriptor(config, "key").get;
                if (getter && getter.isReactWarning) {
                  return false;
                }
              }
            }
            return config.key !== void 0;
          }
          function defineKeyPropWarningGetter(props, displayName) {
            var warnAboutAccessingKey = function() {
              {
                if (!specialPropKeyWarningShown) {
                  specialPropKeyWarningShown = true;
                  error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
                }
              }
            };
            warnAboutAccessingKey.isReactWarning = true;
            Object.defineProperty(props, "key", {
              get: warnAboutAccessingKey,
              configurable: true
            });
          }
          function defineRefPropWarningGetter(props, displayName) {
            var warnAboutAccessingRef = function() {
              {
                if (!specialPropRefWarningShown) {
                  specialPropRefWarningShown = true;
                  error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
                }
              }
            };
            warnAboutAccessingRef.isReactWarning = true;
            Object.defineProperty(props, "ref", {
              get: warnAboutAccessingRef,
              configurable: true
            });
          }
          function warnIfStringRefCannotBeAutoConverted(config) {
            {
              if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
                var componentName = getComponentName(ReactCurrentOwner.current.type);
                if (!didWarnAboutStringRefs[componentName]) {
                  error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
                  didWarnAboutStringRefs[componentName] = true;
                }
              }
            }
          }
          var ReactElement = function(type, key2, ref, self, source, owner, props) {
            var element = {
              $$typeof: REACT_ELEMENT_TYPE,
              type,
              key: key2,
              ref,
              props,
              _owner: owner
            };
            {
              element._store = {};
              Object.defineProperty(element._store, "validated", {
                configurable: false,
                enumerable: false,
                writable: true,
                value: false
              });
              Object.defineProperty(element, "_self", {
                configurable: false,
                enumerable: false,
                writable: false,
                value: self
              });
              Object.defineProperty(element, "_source", {
                configurable: false,
                enumerable: false,
                writable: false,
                value: source
              });
              if (Object.freeze) {
                Object.freeze(element.props);
                Object.freeze(element);
              }
            }
            return element;
          };
          function createElement3(type, config, children) {
            var propName;
            var props = {};
            var key2 = null;
            var ref = null;
            var self = null;
            var source = null;
            if (config != null) {
              if (hasValidRef(config)) {
                ref = config.ref;
                {
                  warnIfStringRefCannotBeAutoConverted(config);
                }
              }
              if (hasValidKey(config)) {
                key2 = "" + config.key;
              }
              self = config.__self === void 0 ? null : config.__self;
              source = config.__source === void 0 ? null : config.__source;
              for (propName in config) {
                if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
                  props[propName] = config[propName];
                }
              }
            }
            var childrenLength = arguments.length - 2;
            if (childrenLength === 1) {
              props.children = children;
            } else if (childrenLength > 1) {
              var childArray = Array(childrenLength);
              for (var i = 0; i < childrenLength; i++) {
                childArray[i] = arguments[i + 2];
              }
              {
                if (Object.freeze) {
                  Object.freeze(childArray);
                }
              }
              props.children = childArray;
            }
            if (type && type.defaultProps) {
              var defaultProps = type.defaultProps;
              for (propName in defaultProps) {
                if (props[propName] === void 0) {
                  props[propName] = defaultProps[propName];
                }
              }
            }
            {
              if (key2 || ref) {
                var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
                if (key2) {
                  defineKeyPropWarningGetter(props, displayName);
                }
                if (ref) {
                  defineRefPropWarningGetter(props, displayName);
                }
              }
            }
            return ReactElement(type, key2, ref, self, source, ReactCurrentOwner.current, props);
          }
          function cloneAndReplaceKey(oldElement, newKey) {
            var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
            return newElement;
          }
          function cloneElement(element, config, children) {
            if (!!(element === null || element === void 0)) {
              {
                throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
              }
            }
            var propName;
            var props = _assign({}, element.props);
            var key2 = element.key;
            var ref = element.ref;
            var self = element._self;
            var source = element._source;
            var owner = element._owner;
            if (config != null) {
              if (hasValidRef(config)) {
                ref = config.ref;
                owner = ReactCurrentOwner.current;
              }
              if (hasValidKey(config)) {
                key2 = "" + config.key;
              }
              var defaultProps;
              if (element.type && element.type.defaultProps) {
                defaultProps = element.type.defaultProps;
              }
              for (propName in config) {
                if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
                  if (config[propName] === void 0 && defaultProps !== void 0) {
                    props[propName] = defaultProps[propName];
                  } else {
                    props[propName] = config[propName];
                  }
                }
              }
            }
            var childrenLength = arguments.length - 2;
            if (childrenLength === 1) {
              props.children = children;
            } else if (childrenLength > 1) {
              var childArray = Array(childrenLength);
              for (var i = 0; i < childrenLength; i++) {
                childArray[i] = arguments[i + 2];
              }
              props.children = childArray;
            }
            return ReactElement(element.type, key2, ref, self, source, owner, props);
          }
          function isValidElement(object) {
            return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
          }
          var SEPARATOR = ".";
          var SUBSEPARATOR = ":";
          function escape(key2) {
            var escapeRegex = /[=:]/g;
            var escaperLookup = {
              "=": "=0",
              ":": "=2"
            };
            var escapedString = key2.replace(escapeRegex, function(match) {
              return escaperLookup[match];
            });
            return "$" + escapedString;
          }
          var didWarnAboutMaps = false;
          var userProvidedKeyEscapeRegex = /\/+/g;
          function escapeUserProvidedKey(text) {
            return text.replace(userProvidedKeyEscapeRegex, "$&/");
          }
          function getElementKey(element, index) {
            if (typeof element === "object" && element !== null && element.key != null) {
              return escape("" + element.key);
            }
            return index.toString(36);
          }
          function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
            var type = typeof children;
            if (type === "undefined" || type === "boolean") {
              children = null;
            }
            var invokeCallback = false;
            if (children === null) {
              invokeCallback = true;
            } else {
              switch (type) {
                case "string":
                case "number":
                  invokeCallback = true;
                  break;
                case "object":
                  switch (children.$$typeof) {
                    case REACT_ELEMENT_TYPE:
                    case REACT_PORTAL_TYPE:
                      invokeCallback = true;
                  }
              }
            }
            if (invokeCallback) {
              var _child = children;
              var mappedChild = callback(_child);
              var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
              if (Array.isArray(mappedChild)) {
                var escapedChildKey = "";
                if (childKey != null) {
                  escapedChildKey = escapeUserProvidedKey(childKey) + "/";
                }
                mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) {
                  return c;
                });
              } else if (mappedChild != null) {
                if (isValidElement(mappedChild)) {
                  mappedChild = cloneAndReplaceKey(
                    mappedChild,
                    escapedPrefix + (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? escapeUserProvidedKey("" + mappedChild.key) + "/" : "") + childKey
                  );
                }
                array.push(mappedChild);
              }
              return 1;
            }
            var child;
            var nextName;
            var subtreeCount = 0;
            var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
            if (Array.isArray(children)) {
              for (var i = 0; i < children.length; i++) {
                child = children[i];
                nextName = nextNamePrefix + getElementKey(child, i);
                subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
              }
            } else {
              var iteratorFn = getIteratorFn(children);
              if (typeof iteratorFn === "function") {
                var iterableChildren = children;
                {
                  if (iteratorFn === iterableChildren.entries) {
                    if (!didWarnAboutMaps) {
                      warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
                    }
                    didWarnAboutMaps = true;
                  }
                }
                var iterator = iteratorFn.call(iterableChildren);
                var step;
                var ii = 0;
                while (!(step = iterator.next()).done) {
                  child = step.value;
                  nextName = nextNamePrefix + getElementKey(child, ii++);
                  subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
                }
              } else if (type === "object") {
                var childrenString = "" + children;
                {
                  {
                    throw Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead.");
                  }
                }
              }
            }
            return subtreeCount;
          }
          function mapChildren(children, func, context) {
            if (children == null) {
              return children;
            }
            var result = [];
            var count = 0;
            mapIntoArray(children, result, "", "", function(child) {
              return func.call(context, child, count++);
            });
            return result;
          }
          function countChildren(children) {
            var n = 0;
            mapChildren(children, function() {
              n++;
            });
            return n;
          }
          function forEachChildren(children, forEachFunc, forEachContext) {
            mapChildren(children, function() {
              forEachFunc.apply(this, arguments);
            }, forEachContext);
          }
          function toArray(children) {
            return mapChildren(children, function(child) {
              return child;
            }) || [];
          }
          function onlyChild(children) {
            if (!isValidElement(children)) {
              {
                throw Error("React.Children.only expected to receive a single React element child.");
              }
            }
            return children;
          }
          function createContext(defaultValue, calculateChangedBits) {
            if (calculateChangedBits === void 0) {
              calculateChangedBits = null;
            } else {
              {
                if (calculateChangedBits !== null && typeof calculateChangedBits !== "function") {
                  error("createContext: Expected the optional second argument to be a function. Instead received: %s", calculateChangedBits);
                }
              }
            }
            var context = {
              $$typeof: REACT_CONTEXT_TYPE,
              _calculateChangedBits: calculateChangedBits,
              _currentValue: defaultValue,
              _currentValue2: defaultValue,
              _threadCount: 0,
              Provider: null,
              Consumer: null
            };
            context.Provider = {
              $$typeof: REACT_PROVIDER_TYPE,
              _context: context
            };
            var hasWarnedAboutUsingNestedContextConsumers = false;
            var hasWarnedAboutUsingConsumerProvider = false;
            var hasWarnedAboutDisplayNameOnConsumer = false;
            {
              var Consumer = {
                $$typeof: REACT_CONTEXT_TYPE,
                _context: context,
                _calculateChangedBits: context._calculateChangedBits
              };
              Object.defineProperties(Consumer, {
                Provider: {
                  get: function() {
                    if (!hasWarnedAboutUsingConsumerProvider) {
                      hasWarnedAboutUsingConsumerProvider = true;
                      error("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");
                    }
                    return context.Provider;
                  },
                  set: function(_Provider) {
                    context.Provider = _Provider;
                  }
                },
                _currentValue: {
                  get: function() {
                    return context._currentValue;
                  },
                  set: function(_currentValue) {
                    context._currentValue = _currentValue;
                  }
                },
                _currentValue2: {
                  get: function() {
                    return context._currentValue2;
                  },
                  set: function(_currentValue2) {
                    context._currentValue2 = _currentValue2;
                  }
                },
                _threadCount: {
                  get: function() {
                    return context._threadCount;
                  },
                  set: function(_threadCount) {
                    context._threadCount = _threadCount;
                  }
                },
                Consumer: {
                  get: function() {
                    if (!hasWarnedAboutUsingNestedContextConsumers) {
                      hasWarnedAboutUsingNestedContextConsumers = true;
                      error("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
                    }
                    return context.Consumer;
                  }
                },
                displayName: {
                  get: function() {
                    return context.displayName;
                  },
                  set: function(displayName) {
                    if (!hasWarnedAboutDisplayNameOnConsumer) {
                      warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName);
                      hasWarnedAboutDisplayNameOnConsumer = true;
                    }
                  }
                }
              });
              context.Consumer = Consumer;
            }
            {
              context._currentRenderer = null;
              context._currentRenderer2 = null;
            }
            return context;
          }
          var Uninitialized = -1;
          var Pending = 0;
          var Resolved = 1;
          var Rejected = 2;
          function lazyInitializer(payload) {
            if (payload._status === Uninitialized) {
              var ctor = payload._result;
              var thenable = ctor();
              var pending = payload;
              pending._status = Pending;
              pending._result = thenable;
              thenable.then(function(moduleObject) {
                if (payload._status === Pending) {
                  var defaultExport = moduleObject.default;
                  {
                    if (defaultExport === void 0) {
                      error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n  const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
                    }
                  }
                  var resolved = payload;
                  resolved._status = Resolved;
                  resolved._result = defaultExport;
                }
              }, function(error2) {
                if (payload._status === Pending) {
                  var rejected = payload;
                  rejected._status = Rejected;
                  rejected._result = error2;
                }
              });
            }
            if (payload._status === Resolved) {
              return payload._result;
            } else {
              throw payload._result;
            }
          }
          function lazy(ctor) {
            var payload = {
              _status: -1,
              _result: ctor
            };
            var lazyType = {
              $$typeof: REACT_LAZY_TYPE,
              _payload: payload,
              _init: lazyInitializer
            };
            {
              var defaultProps;
              var propTypes;
              Object.defineProperties(lazyType, {
                defaultProps: {
                  configurable: true,
                  get: function() {
                    return defaultProps;
                  },
                  set: function(newDefaultProps) {
                    error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
                    defaultProps = newDefaultProps;
                    Object.defineProperty(lazyType, "defaultProps", {
                      enumerable: true
                    });
                  }
                },
                propTypes: {
                  configurable: true,
                  get: function() {
                    return propTypes;
                  },
                  set: function(newPropTypes) {
                    error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
                    propTypes = newPropTypes;
                    Object.defineProperty(lazyType, "propTypes", {
                      enumerable: true
                    });
                  }
                }
              });
            }
            return lazyType;
          }
          function forwardRef(render) {
            {
              if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
                error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");
              } else if (typeof render !== "function") {
                error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render);
              } else {
                if (render.length !== 0 && render.length !== 2) {
                  error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
                }
              }
              if (render != null) {
                if (render.defaultProps != null || render.propTypes != null) {
                  error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
                }
              }
            }
            var elementType = {
              $$typeof: REACT_FORWARD_REF_TYPE,
              render
            };
            {
              var ownName;
              Object.defineProperty(elementType, "displayName", {
                enumerable: false,
                configurable: true,
                get: function() {
                  return ownName;
                },
                set: function(name) {
                  ownName = name;
                  if (render.displayName == null) {
                    render.displayName = name;
                  }
                }
              });
            }
            return elementType;
          }
          var enableScopeAPI = false;
          function isValidElementType(type) {
            if (typeof type === "string" || typeof type === "function") {
              return true;
            }
            if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI) {
              return true;
            }
            if (typeof type === "object" && type !== null) {
              if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
                return true;
              }
            }
            return false;
          }
          function memo(type, compare) {
            {
              if (!isValidElementType(type)) {
                error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
              }
            }
            var elementType = {
              $$typeof: REACT_MEMO_TYPE,
              type,
              compare: compare === void 0 ? null : compare
            };
            {
              var ownName;
              Object.defineProperty(elementType, "displayName", {
                enumerable: false,
                configurable: true,
                get: function() {
                  return ownName;
                },
                set: function(name) {
                  ownName = name;
                  if (type.displayName == null) {
                    type.displayName = name;
                  }
                }
              });
            }
            return elementType;
          }
          function resolveDispatcher() {
            var dispatcher = ReactCurrentDispatcher.current;
            if (!(dispatcher !== null)) {
              {
                throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
              }
            }
            return dispatcher;
          }
          function useContext(Context, unstable_observedBits) {
            var dispatcher = resolveDispatcher();
            {
              if (unstable_observedBits !== void 0) {
                error("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s", unstable_observedBits, typeof unstable_observedBits === "number" && Array.isArray(arguments[2]) ? "\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://reactjs.org/link/rules-of-hooks" : "");
              }
              if (Context._context !== void 0) {
                var realContext = Context._context;
                if (realContext.Consumer === Context) {
                  error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
                } else if (realContext.Provider === Context) {
                  error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
                }
              }
            }
            return dispatcher.useContext(Context, unstable_observedBits);
          }
          function useState52(initialState) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useState(initialState);
          }
          function useReducer(reducer, initialArg, init) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useReducer(reducer, initialArg, init);
          }
          function useRef11(initialValue) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useRef(initialValue);
          }
          function useEffect43(create, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useEffect(create, deps);
          }
          function useLayoutEffect(create, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useLayoutEffect(create, deps);
          }
          function useCallback10(callback, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useCallback(callback, deps);
          }
          function useMemo2(create, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useMemo(create, deps);
          }
          function useImperativeHandle(ref, create, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useImperativeHandle(ref, create, deps);
          }
          function useDebugValue(value, formatterFn) {
            {
              var dispatcher = resolveDispatcher();
              return dispatcher.useDebugValue(value, formatterFn);
            }
          }
          var disabledDepth = 0;
          var prevLog;
          var prevInfo;
          var prevWarn;
          var prevError;
          var prevGroup;
          var prevGroupCollapsed;
          var prevGroupEnd;
          function disabledLog() {
          }
          disabledLog.__reactDisabledLog = true;
          function disableLogs() {
            {
              if (disabledDepth === 0) {
                prevLog = console.log;
                prevInfo = console.info;
                prevWarn = console.warn;
                prevError = console.error;
                prevGroup = console.group;
                prevGroupCollapsed = console.groupCollapsed;
                prevGroupEnd = console.groupEnd;
                var props = {
                  configurable: true,
                  enumerable: true,
                  value: disabledLog,
                  writable: true
                };
                Object.defineProperties(console, {
                  info: props,
                  log: props,
                  warn: props,
                  error: props,
                  group: props,
                  groupCollapsed: props,
                  groupEnd: props
                });
              }
              disabledDepth++;
            }
          }
          function reenableLogs() {
            {
              disabledDepth--;
              if (disabledDepth === 0) {
                var props = {
                  configurable: true,
                  enumerable: true,
                  writable: true
                };
                Object.defineProperties(console, {
                  log: _assign({}, props, {
                    value: prevLog
                  }),
                  info: _assign({}, props, {
                    value: prevInfo
                  }),
                  warn: _assign({}, props, {
                    value: prevWarn
                  }),
                  error: _assign({}, props, {
                    value: prevError
                  }),
                  group: _assign({}, props, {
                    value: prevGroup
                  }),
                  groupCollapsed: _assign({}, props, {
                    value: prevGroupCollapsed
                  }),
                  groupEnd: _assign({}, props, {
                    value: prevGroupEnd
                  })
                });
              }
              if (disabledDepth < 0) {
                error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
              }
            }
          }
          var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
          var prefix;
          function describeBuiltInComponentFrame(name, source, ownerFn) {
            {
              if (prefix === void 0) {
                try {
                  throw Error();
                } catch (x) {
                  var match = x.stack.trim().match(/\n( *(at )?)/);
                  prefix = match && match[1] || "";
                }
              }
              return "\n" + prefix + name;
            }
          }
          var reentry = false;
          var componentFrameCache;
          {
            var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
            componentFrameCache = new PossiblyWeakMap();
          }
          function describeNativeComponentFrame(fn, construct) {
            if (!fn || reentry) {
              return "";
            }
            {
              var frame = componentFrameCache.get(fn);
              if (frame !== void 0) {
                return frame;
              }
            }
            var control;
            reentry = true;
            var previousPrepareStackTrace = Error.prepareStackTrace;
            Error.prepareStackTrace = void 0;
            var previousDispatcher;
            {
              previousDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = null;
              disableLogs();
            }
            try {
              if (construct) {
                var Fake = function() {
                  throw Error();
                };
                Object.defineProperty(Fake.prototype, "props", {
                  set: function() {
                    throw Error();
                  }
                });
                if (typeof Reflect === "object" && Reflect.construct) {
                  try {
                    Reflect.construct(Fake, []);
                  } catch (x) {
                    control = x;
                  }
                  Reflect.construct(fn, [], Fake);
                } else {
                  try {
                    Fake.call();
                  } catch (x) {
                    control = x;
                  }
                  fn.call(Fake.prototype);
                }
              } else {
                try {
                  throw Error();
                } catch (x) {
                  control = x;
                }
                fn();
              }
            } catch (sample) {
              if (sample && control && typeof sample.stack === "string") {
                var sampleLines = sample.stack.split("\n");
                var controlLines = control.stack.split("\n");
                var s = sampleLines.length - 1;
                var c = controlLines.length - 1;
                while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
                  c--;
                }
                for (; s >= 1 && c >= 0; s--, c--) {
                  if (sampleLines[s] !== controlLines[c]) {
                    if (s !== 1 || c !== 1) {
                      do {
                        s--;
                        c--;
                        if (c < 0 || sampleLines[s] !== controlLines[c]) {
                          var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
                          {
                            if (typeof fn === "function") {
                              componentFrameCache.set(fn, _frame);
                            }
                          }
                          return _frame;
                        }
                      } while (s >= 1 && c >= 0);
                    }
                    break;
                  }
                }
              }
            } finally {
              reentry = false;
              {
                ReactCurrentDispatcher$1.current = previousDispatcher;
                reenableLogs();
              }
              Error.prepareStackTrace = previousPrepareStackTrace;
            }
            var name = fn ? fn.displayName || fn.name : "";
            var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
            {
              if (typeof fn === "function") {
                componentFrameCache.set(fn, syntheticFrame);
              }
            }
            return syntheticFrame;
          }
          function describeFunctionComponentFrame(fn, source, ownerFn) {
            {
              return describeNativeComponentFrame(fn, false);
            }
          }
          function shouldConstruct(Component3) {
            var prototype = Component3.prototype;
            return !!(prototype && prototype.isReactComponent);
          }
          function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
            if (type == null) {
              return "";
            }
            if (typeof type === "function") {
              {
                return describeNativeComponentFrame(type, shouldConstruct(type));
              }
            }
            if (typeof type === "string") {
              return describeBuiltInComponentFrame(type);
            }
            switch (type) {
              case exports.Suspense:
                return describeBuiltInComponentFrame("Suspense");
              case REACT_SUSPENSE_LIST_TYPE:
                return describeBuiltInComponentFrame("SuspenseList");
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_FORWARD_REF_TYPE:
                  return describeFunctionComponentFrame(type.render);
                case REACT_MEMO_TYPE:
                  return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
                case REACT_BLOCK_TYPE:
                  return describeFunctionComponentFrame(type._render);
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
                  } catch (x) {
                  }
                }
              }
            }
            return "";
          }
          var loggedTypeFailures = {};
          var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
          function setCurrentlyValidatingElement(element) {
            {
              if (element) {
                var owner = element._owner;
                var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
                ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
              } else {
                ReactDebugCurrentFrame$1.setExtraStackFrame(null);
              }
            }
          }
          function checkPropTypes(typeSpecs, values, location, componentName, element) {
            {
              var has = Function.call.bind(Object.prototype.hasOwnProperty);
              for (var typeSpecName in typeSpecs) {
                if (has(typeSpecs, typeSpecName)) {
                  var error$1 = void 0;
                  try {
                    if (typeof typeSpecs[typeSpecName] !== "function") {
                      var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                      err.name = "Invariant Violation";
                      throw err;
                    }
                    error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                  } catch (ex) {
                    error$1 = ex;
                  }
                  if (error$1 && !(error$1 instanceof Error)) {
                    setCurrentlyValidatingElement(element);
                    error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
                    setCurrentlyValidatingElement(null);
                  }
                  if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
                    loggedTypeFailures[error$1.message] = true;
                    setCurrentlyValidatingElement(element);
                    error("Failed %s type: %s", location, error$1.message);
                    setCurrentlyValidatingElement(null);
                  }
                }
              }
            }
          }
          function setCurrentlyValidatingElement$1(element) {
            {
              if (element) {
                var owner = element._owner;
                var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
                setExtraStackFrame(stack);
              } else {
                setExtraStackFrame(null);
              }
            }
          }
          var propTypesMisspellWarningShown;
          {
            propTypesMisspellWarningShown = false;
          }
          function getDeclarationErrorAddendum() {
            if (ReactCurrentOwner.current) {
              var name = getComponentName(ReactCurrentOwner.current.type);
              if (name) {
                return "\n\nCheck the render method of `" + name + "`.";
              }
            }
            return "";
          }
          function getSourceInfoErrorAddendum(source) {
            if (source !== void 0) {
              var fileName = source.fileName.replace(/^.*[\\\/]/, "");
              var lineNumber = source.lineNumber;
              return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
            }
            return "";
          }
          function getSourceInfoErrorAddendumForProps(elementProps) {
            if (elementProps !== null && elementProps !== void 0) {
              return getSourceInfoErrorAddendum(elementProps.__source);
            }
            return "";
          }
          var ownerHasKeyUseWarning = {};
          function getCurrentComponentErrorInfo(parentType) {
            var info = getDeclarationErrorAddendum();
            if (!info) {
              var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
              if (parentName) {
                info = "\n\nCheck the top-level render call using <" + parentName + ">.";
              }
            }
            return info;
          }
          function validateExplicitKey(element, parentType) {
            if (!element._store || element._store.validated || element.key != null) {
              return;
            }
            element._store.validated = true;
            var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
            if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
              return;
            }
            ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
            var childOwner = "";
            if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
              childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
            }
            {
              setCurrentlyValidatingElement$1(element);
              error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
              setCurrentlyValidatingElement$1(null);
            }
          }
          function validateChildKeys(node, parentType) {
            if (typeof node !== "object") {
              return;
            }
            if (Array.isArray(node)) {
              for (var i = 0; i < node.length; i++) {
                var child = node[i];
                if (isValidElement(child)) {
                  validateExplicitKey(child, parentType);
                }
              }
            } else if (isValidElement(node)) {
              if (node._store) {
                node._store.validated = true;
              }
            } else if (node) {
              var iteratorFn = getIteratorFn(node);
              if (typeof iteratorFn === "function") {
                if (iteratorFn !== node.entries) {
                  var iterator = iteratorFn.call(node);
                  var step;
                  while (!(step = iterator.next()).done) {
                    if (isValidElement(step.value)) {
                      validateExplicitKey(step.value, parentType);
                    }
                  }
                }
              }
            }
          }
          function validatePropTypes(element) {
            {
              var type = element.type;
              if (type === null || type === void 0 || typeof type === "string") {
                return;
              }
              var propTypes;
              if (typeof type === "function") {
                propTypes = type.propTypes;
              } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) {
                propTypes = type.propTypes;
              } else {
                return;
              }
              if (propTypes) {
                var name = getComponentName(type);
                checkPropTypes(propTypes, element.props, "prop", name, element);
              } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
                propTypesMisspellWarningShown = true;
                var _name = getComponentName(type);
                error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
              }
              if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
                error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
              }
            }
          }
          function validateFragmentProps(fragment) {
            {
              var keys = Object.keys(fragment.props);
              for (var i = 0; i < keys.length; i++) {
                var key2 = keys[i];
                if (key2 !== "children" && key2 !== "key") {
                  setCurrentlyValidatingElement$1(fragment);
                  error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key2);
                  setCurrentlyValidatingElement$1(null);
                  break;
                }
              }
              if (fragment.ref !== null) {
                setCurrentlyValidatingElement$1(fragment);
                error("Invalid attribute `ref` supplied to `React.Fragment`.");
                setCurrentlyValidatingElement$1(null);
              }
            }
          }
          function createElementWithValidation(type, props, children) {
            var validType = isValidElementType(type);
            if (!validType) {
              var info = "";
              if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
                info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
              }
              var sourceInfo = getSourceInfoErrorAddendumForProps(props);
              if (sourceInfo) {
                info += sourceInfo;
              } else {
                info += getDeclarationErrorAddendum();
              }
              var typeString;
              if (type === null) {
                typeString = "null";
              } else if (Array.isArray(type)) {
                typeString = "array";
              } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
                typeString = "<" + (getComponentName(type.type) || "Unknown") + " />";
                info = " Did you accidentally export a JSX literal instead of a component?";
              } else {
                typeString = typeof type;
              }
              {
                error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
              }
            }
            var element = createElement3.apply(this, arguments);
            if (element == null) {
              return element;
            }
            if (validType) {
              for (var i = 2; i < arguments.length; i++) {
                validateChildKeys(arguments[i], type);
              }
            }
            if (type === exports.Fragment) {
              validateFragmentProps(element);
            } else {
              validatePropTypes(element);
            }
            return element;
          }
          var didWarnAboutDeprecatedCreateFactory = false;
          function createFactoryWithValidation(type) {
            var validatedFactory = createElementWithValidation.bind(null, type);
            validatedFactory.type = type;
            {
              if (!didWarnAboutDeprecatedCreateFactory) {
                didWarnAboutDeprecatedCreateFactory = true;
                warn("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");
              }
              Object.defineProperty(validatedFactory, "type", {
                enumerable: false,
                get: function() {
                  warn("Factory.type is deprecated. Access the class directly before passing it to createFactory.");
                  Object.defineProperty(this, "type", {
                    value: type
                  });
                  return type;
                }
              });
            }
            return validatedFactory;
          }
          function cloneElementWithValidation(element, props, children) {
            var newElement = cloneElement.apply(this, arguments);
            for (var i = 2; i < arguments.length; i++) {
              validateChildKeys(arguments[i], newElement.type);
            }
            validatePropTypes(newElement);
            return newElement;
          }
          {
            try {
              var frozenObject = Object.freeze({});
              /* @__PURE__ */ new Map([[frozenObject, null]]);
              /* @__PURE__ */ new Set([frozenObject]);
            } catch (e) {
            }
          }
          var createElement$1 = createElementWithValidation;
          var cloneElement$1 = cloneElementWithValidation;
          var createFactory = createFactoryWithValidation;
          var Children = {
            map: mapChildren,
            forEach: forEachChildren,
            count: countChildren,
            toArray,
            only: onlyChild
          };
          exports.Children = Children;
          exports.Component = Component2;
          exports.PureComponent = PureComponent;
          exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
          exports.cloneElement = cloneElement$1;
          exports.createContext = createContext;
          exports.createElement = createElement$1;
          exports.createFactory = createFactory;
          exports.createRef = createRef;
          exports.forwardRef = forwardRef;
          exports.isValidElement = isValidElement;
          exports.lazy = lazy;
          exports.memo = memo;
          exports.useCallback = useCallback10;
          exports.useContext = useContext;
          exports.useDebugValue = useDebugValue;
          exports.useEffect = useEffect43;
          exports.useImperativeHandle = useImperativeHandle;
          exports.useLayoutEffect = useLayoutEffect;
          exports.useMemo = useMemo2;
          exports.useReducer = useReducer;
          exports.useRef = useRef11;
          exports.useState = useState52;
          exports.version = ReactVersion;
        })();
      }
    }
  });

  // node_modules/react/index.js
  var require_react = __commonJS({
    "node_modules/react/index.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_react_development();
      }
    }
  });

  // node_modules/scheduler/cjs/scheduler.development.js
  var require_scheduler_development = __commonJS({
    "node_modules/scheduler/cjs/scheduler.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          var enableSchedulerDebugging = false;
          var enableProfiling = false;
          var requestHostCallback;
          var requestHostTimeout;
          var cancelHostTimeout;
          var requestPaint;
          var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function";
          if (hasPerformanceNow) {
            var localPerformance = performance;
            exports.unstable_now = function() {
              return localPerformance.now();
            };
          } else {
            var localDate = Date;
            var initialTime = localDate.now();
            exports.unstable_now = function() {
              return localDate.now() - initialTime;
            };
          }
          if (typeof window === "undefined" || typeof MessageChannel !== "function") {
            var _callback = null;
            var _timeoutID = null;
            var _flushCallback = function() {
              if (_callback !== null) {
                try {
                  var currentTime = exports.unstable_now();
                  var hasRemainingTime = true;
                  _callback(hasRemainingTime, currentTime);
                  _callback = null;
                } catch (e) {
                  setTimeout(_flushCallback, 0);
                  throw e;
                }
              }
            };
            requestHostCallback = function(cb) {
              if (_callback !== null) {
                setTimeout(requestHostCallback, 0, cb);
              } else {
                _callback = cb;
                setTimeout(_flushCallback, 0);
              }
            };
            requestHostTimeout = function(cb, ms2) {
              _timeoutID = setTimeout(cb, ms2);
            };
            cancelHostTimeout = function() {
              clearTimeout(_timeoutID);
            };
            exports.unstable_shouldYield = function() {
              return false;
            };
            requestPaint = exports.unstable_forceFrameRate = function() {
            };
          } else {
            var _setTimeout = window.setTimeout;
            var _clearTimeout = window.clearTimeout;
            if (typeof console !== "undefined") {
              var requestAnimationFrame = window.requestAnimationFrame;
              var cancelAnimationFrame = window.cancelAnimationFrame;
              if (typeof requestAnimationFrame !== "function") {
                console["error"]("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
              }
              if (typeof cancelAnimationFrame !== "function") {
                console["error"]("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
              }
            }
            var isMessageLoopRunning = false;
            var scheduledHostCallback = null;
            var taskTimeoutID = -1;
            var yieldInterval = 5;
            var deadline = 0;
            {
              exports.unstable_shouldYield = function() {
                return exports.unstable_now() >= deadline;
              };
              requestPaint = function() {
              };
            }
            exports.unstable_forceFrameRate = function(fps) {
              if (fps < 0 || fps > 125) {
                console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");
                return;
              }
              if (fps > 0) {
                yieldInterval = Math.floor(1e3 / fps);
              } else {
                yieldInterval = 5;
              }
            };
            var performWorkUntilDeadline = function() {
              if (scheduledHostCallback !== null) {
                var currentTime = exports.unstable_now();
                deadline = currentTime + yieldInterval;
                var hasTimeRemaining = true;
                try {
                  var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
                  if (!hasMoreWork) {
                    isMessageLoopRunning = false;
                    scheduledHostCallback = null;
                  } else {
                    port.postMessage(null);
                  }
                } catch (error) {
                  port.postMessage(null);
                  throw error;
                }
              } else {
                isMessageLoopRunning = false;
              }
            };
            var channel = new MessageChannel();
            var port = channel.port2;
            channel.port1.onmessage = performWorkUntilDeadline;
            requestHostCallback = function(callback) {
              scheduledHostCallback = callback;
              if (!isMessageLoopRunning) {
                isMessageLoopRunning = true;
                port.postMessage(null);
              }
            };
            requestHostTimeout = function(callback, ms2) {
              taskTimeoutID = _setTimeout(function() {
                callback(exports.unstable_now());
              }, ms2);
            };
            cancelHostTimeout = function() {
              _clearTimeout(taskTimeoutID);
              taskTimeoutID = -1;
            };
          }
          function push(heap, node) {
            var index = heap.length;
            heap.push(node);
            siftUp(heap, node, index);
          }
          function peek(heap) {
            var first = heap[0];
            return first === void 0 ? null : first;
          }
          function pop(heap) {
            var first = heap[0];
            if (first !== void 0) {
              var last = heap.pop();
              if (last !== first) {
                heap[0] = last;
                siftDown(heap, last, 0);
              }
              return first;
            } else {
              return null;
            }
          }
          function siftUp(heap, node, i) {
            var index = i;
            while (true) {
              var parentIndex = index - 1 >>> 1;
              var parent = heap[parentIndex];
              if (parent !== void 0 && compare(parent, node) > 0) {
                heap[parentIndex] = node;
                heap[index] = parent;
                index = parentIndex;
              } else {
                return;
              }
            }
          }
          function siftDown(heap, node, i) {
            var index = i;
            var length = heap.length;
            while (index < length) {
              var leftIndex = (index + 1) * 2 - 1;
              var left = heap[leftIndex];
              var rightIndex = leftIndex + 1;
              var right = heap[rightIndex];
              if (left !== void 0 && compare(left, node) < 0) {
                if (right !== void 0 && compare(right, left) < 0) {
                  heap[index] = right;
                  heap[rightIndex] = node;
                  index = rightIndex;
                } else {
                  heap[index] = left;
                  heap[leftIndex] = node;
                  index = leftIndex;
                }
              } else if (right !== void 0 && compare(right, node) < 0) {
                heap[index] = right;
                heap[rightIndex] = node;
                index = rightIndex;
              } else {
                return;
              }
            }
          }
          function compare(a, b) {
            var diff = a.sortIndex - b.sortIndex;
            return diff !== 0 ? diff : a.id - b.id;
          }
          var ImmediatePriority = 1;
          var UserBlockingPriority = 2;
          var NormalPriority = 3;
          var LowPriority = 4;
          var IdlePriority = 5;
          function markTaskErrored(task, ms2) {
          }
          var maxSigned31BitInt = 1073741823;
          var IMMEDIATE_PRIORITY_TIMEOUT = -1;
          var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
          var NORMAL_PRIORITY_TIMEOUT = 5e3;
          var LOW_PRIORITY_TIMEOUT = 1e4;
          var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt;
          var taskQueue = [];
          var timerQueue = [];
          var taskIdCounter = 1;
          var currentTask = null;
          var currentPriorityLevel = NormalPriority;
          var isPerformingWork = false;
          var isHostCallbackScheduled = false;
          var isHostTimeoutScheduled = false;
          function advanceTimers(currentTime) {
            var timer = peek(timerQueue);
            while (timer !== null) {
              if (timer.callback === null) {
                pop(timerQueue);
              } else if (timer.startTime <= currentTime) {
                pop(timerQueue);
                timer.sortIndex = timer.expirationTime;
                push(taskQueue, timer);
              } else {
                return;
              }
              timer = peek(timerQueue);
            }
          }
          function handleTimeout(currentTime) {
            isHostTimeoutScheduled = false;
            advanceTimers(currentTime);
            if (!isHostCallbackScheduled) {
              if (peek(taskQueue) !== null) {
                isHostCallbackScheduled = true;
                requestHostCallback(flushWork);
              } else {
                var firstTimer = peek(timerQueue);
                if (firstTimer !== null) {
                  requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
                }
              }
            }
          }
          function flushWork(hasTimeRemaining, initialTime2) {
            isHostCallbackScheduled = false;
            if (isHostTimeoutScheduled) {
              isHostTimeoutScheduled = false;
              cancelHostTimeout();
            }
            isPerformingWork = true;
            var previousPriorityLevel = currentPriorityLevel;
            try {
              if (enableProfiling) {
                try {
                  return workLoop(hasTimeRemaining, initialTime2);
                } catch (error) {
                  if (currentTask !== null) {
                    var currentTime = exports.unstable_now();
                    markTaskErrored(currentTask, currentTime);
                    currentTask.isQueued = false;
                  }
                  throw error;
                }
              } else {
                return workLoop(hasTimeRemaining, initialTime2);
              }
            } finally {
              currentTask = null;
              currentPriorityLevel = previousPriorityLevel;
              isPerformingWork = false;
            }
          }
          function workLoop(hasTimeRemaining, initialTime2) {
            var currentTime = initialTime2;
            advanceTimers(currentTime);
            currentTask = peek(taskQueue);
            while (currentTask !== null && !enableSchedulerDebugging) {
              if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || exports.unstable_shouldYield())) {
                break;
              }
              var callback = currentTask.callback;
              if (typeof callback === "function") {
                currentTask.callback = null;
                currentPriorityLevel = currentTask.priorityLevel;
                var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
                var continuationCallback = callback(didUserCallbackTimeout);
                currentTime = exports.unstable_now();
                if (typeof continuationCallback === "function") {
                  currentTask.callback = continuationCallback;
                } else {
                  if (currentTask === peek(taskQueue)) {
                    pop(taskQueue);
                  }
                }
                advanceTimers(currentTime);
              } else {
                pop(taskQueue);
              }
              currentTask = peek(taskQueue);
            }
            if (currentTask !== null) {
              return true;
            } else {
              var firstTimer = peek(timerQueue);
              if (firstTimer !== null) {
                requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
              }
              return false;
            }
          }
          function unstable_runWithPriority(priorityLevel, eventHandler) {
            switch (priorityLevel) {
              case ImmediatePriority:
              case UserBlockingPriority:
              case NormalPriority:
              case LowPriority:
              case IdlePriority:
                break;
              default:
                priorityLevel = NormalPriority;
            }
            var previousPriorityLevel = currentPriorityLevel;
            currentPriorityLevel = priorityLevel;
            try {
              return eventHandler();
            } finally {
              currentPriorityLevel = previousPriorityLevel;
            }
          }
          function unstable_next(eventHandler) {
            var priorityLevel;
            switch (currentPriorityLevel) {
              case ImmediatePriority:
              case UserBlockingPriority:
              case NormalPriority:
                priorityLevel = NormalPriority;
                break;
              default:
                priorityLevel = currentPriorityLevel;
                break;
            }
            var previousPriorityLevel = currentPriorityLevel;
            currentPriorityLevel = priorityLevel;
            try {
              return eventHandler();
            } finally {
              currentPriorityLevel = previousPriorityLevel;
            }
          }
          function unstable_wrapCallback(callback) {
            var parentPriorityLevel = currentPriorityLevel;
            return function() {
              var previousPriorityLevel = currentPriorityLevel;
              currentPriorityLevel = parentPriorityLevel;
              try {
                return callback.apply(this, arguments);
              } finally {
                currentPriorityLevel = previousPriorityLevel;
              }
            };
          }
          function unstable_scheduleCallback(priorityLevel, callback, options) {
            var currentTime = exports.unstable_now();
            var startTime;
            if (typeof options === "object" && options !== null) {
              var delay = options.delay;
              if (typeof delay === "number" && delay > 0) {
                startTime = currentTime + delay;
              } else {
                startTime = currentTime;
              }
            } else {
              startTime = currentTime;
            }
            var timeout;
            switch (priorityLevel) {
              case ImmediatePriority:
                timeout = IMMEDIATE_PRIORITY_TIMEOUT;
                break;
              case UserBlockingPriority:
                timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
                break;
              case IdlePriority:
                timeout = IDLE_PRIORITY_TIMEOUT;
                break;
              case LowPriority:
                timeout = LOW_PRIORITY_TIMEOUT;
                break;
              case NormalPriority:
              default:
                timeout = NORMAL_PRIORITY_TIMEOUT;
                break;
            }
            var expirationTime = startTime + timeout;
            var newTask = {
              id: taskIdCounter++,
              callback,
              priorityLevel,
              startTime,
              expirationTime,
              sortIndex: -1
            };
            if (startTime > currentTime) {
              newTask.sortIndex = startTime;
              push(timerQueue, newTask);
              if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
                if (isHostTimeoutScheduled) {
                  cancelHostTimeout();
                } else {
                  isHostTimeoutScheduled = true;
                }
                requestHostTimeout(handleTimeout, startTime - currentTime);
              }
            } else {
              newTask.sortIndex = expirationTime;
              push(taskQueue, newTask);
              if (!isHostCallbackScheduled && !isPerformingWork) {
                isHostCallbackScheduled = true;
                requestHostCallback(flushWork);
              }
            }
            return newTask;
          }
          function unstable_pauseExecution() {
          }
          function unstable_continueExecution() {
            if (!isHostCallbackScheduled && !isPerformingWork) {
              isHostCallbackScheduled = true;
              requestHostCallback(flushWork);
            }
          }
          function unstable_getFirstCallbackNode() {
            return peek(taskQueue);
          }
          function unstable_cancelCallback(task) {
            task.callback = null;
          }
          function unstable_getCurrentPriorityLevel() {
            return currentPriorityLevel;
          }
          var unstable_requestPaint = requestPaint;
          var unstable_Profiling = null;
          exports.unstable_IdlePriority = IdlePriority;
          exports.unstable_ImmediatePriority = ImmediatePriority;
          exports.unstable_LowPriority = LowPriority;
          exports.unstable_NormalPriority = NormalPriority;
          exports.unstable_Profiling = unstable_Profiling;
          exports.unstable_UserBlockingPriority = UserBlockingPriority;
          exports.unstable_cancelCallback = unstable_cancelCallback;
          exports.unstable_continueExecution = unstable_continueExecution;
          exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
          exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
          exports.unstable_next = unstable_next;
          exports.unstable_pauseExecution = unstable_pauseExecution;
          exports.unstable_requestPaint = unstable_requestPaint;
          exports.unstable_runWithPriority = unstable_runWithPriority;
          exports.unstable_scheduleCallback = unstable_scheduleCallback;
          exports.unstable_wrapCallback = unstable_wrapCallback;
        })();
      }
    }
  });

  // node_modules/scheduler/index.js
  var require_scheduler = __commonJS({
    "node_modules/scheduler/index.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_scheduler_development();
      }
    }
  });

  // node_modules/scheduler/cjs/scheduler-tracing.development.js
  var require_scheduler_tracing_development = __commonJS({
    "node_modules/scheduler/cjs/scheduler-tracing.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          var DEFAULT_THREAD_ID = 0;
          var interactionIDCounter = 0;
          var threadIDCounter = 0;
          exports.__interactionsRef = null;
          exports.__subscriberRef = null;
          {
            exports.__interactionsRef = {
              current: /* @__PURE__ */ new Set()
            };
            exports.__subscriberRef = {
              current: null
            };
          }
          function unstable_clear(callback) {
            var prevInteractions = exports.__interactionsRef.current;
            exports.__interactionsRef.current = /* @__PURE__ */ new Set();
            try {
              return callback();
            } finally {
              exports.__interactionsRef.current = prevInteractions;
            }
          }
          function unstable_getCurrent() {
            {
              return exports.__interactionsRef.current;
            }
          }
          function unstable_getThreadID() {
            return ++threadIDCounter;
          }
          function unstable_trace(name, timestamp, callback) {
            var threadID = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : DEFAULT_THREAD_ID;
            var interaction = {
              __count: 1,
              id: interactionIDCounter++,
              name,
              timestamp
            };
            var prevInteractions = exports.__interactionsRef.current;
            var interactions = new Set(prevInteractions);
            interactions.add(interaction);
            exports.__interactionsRef.current = interactions;
            var subscriber = exports.__subscriberRef.current;
            var returnValue;
            try {
              if (subscriber !== null) {
                subscriber.onInteractionTraced(interaction);
              }
            } finally {
              try {
                if (subscriber !== null) {
                  subscriber.onWorkStarted(interactions, threadID);
                }
              } finally {
                try {
                  returnValue = callback();
                } finally {
                  exports.__interactionsRef.current = prevInteractions;
                  try {
                    if (subscriber !== null) {
                      subscriber.onWorkStopped(interactions, threadID);
                    }
                  } finally {
                    interaction.__count--;
                    if (subscriber !== null && interaction.__count === 0) {
                      subscriber.onInteractionScheduledWorkCompleted(interaction);
                    }
                  }
                }
              }
            }
            return returnValue;
          }
          function unstable_wrap(callback) {
            var threadID = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : DEFAULT_THREAD_ID;
            var wrappedInteractions = exports.__interactionsRef.current;
            var subscriber = exports.__subscriberRef.current;
            if (subscriber !== null) {
              subscriber.onWorkScheduled(wrappedInteractions, threadID);
            }
            wrappedInteractions.forEach(function(interaction) {
              interaction.__count++;
            });
            var hasRun = false;
            function wrapped() {
              var prevInteractions = exports.__interactionsRef.current;
              exports.__interactionsRef.current = wrappedInteractions;
              subscriber = exports.__subscriberRef.current;
              try {
                var returnValue;
                try {
                  if (subscriber !== null) {
                    subscriber.onWorkStarted(wrappedInteractions, threadID);
                  }
                } finally {
                  try {
                    returnValue = callback.apply(void 0, arguments);
                  } finally {
                    exports.__interactionsRef.current = prevInteractions;
                    if (subscriber !== null) {
                      subscriber.onWorkStopped(wrappedInteractions, threadID);
                    }
                  }
                }
                return returnValue;
              } finally {
                if (!hasRun) {
                  hasRun = true;
                  wrappedInteractions.forEach(function(interaction) {
                    interaction.__count--;
                    if (subscriber !== null && interaction.__count === 0) {
                      subscriber.onInteractionScheduledWorkCompleted(interaction);
                    }
                  });
                }
              }
            }
            wrapped.cancel = function cancel() {
              subscriber = exports.__subscriberRef.current;
              try {
                if (subscriber !== null) {
                  subscriber.onWorkCanceled(wrappedInteractions, threadID);
                }
              } finally {
                wrappedInteractions.forEach(function(interaction) {
                  interaction.__count--;
                  if (subscriber && interaction.__count === 0) {
                    subscriber.onInteractionScheduledWorkCompleted(interaction);
                  }
                });
              }
            };
            return wrapped;
          }
          var subscribers = null;
          {
            subscribers = /* @__PURE__ */ new Set();
          }
          function unstable_subscribe(subscriber) {
            {
              subscribers.add(subscriber);
              if (subscribers.size === 1) {
                exports.__subscriberRef.current = {
                  onInteractionScheduledWorkCompleted,
                  onInteractionTraced,
                  onWorkCanceled,
                  onWorkScheduled,
                  onWorkStarted,
                  onWorkStopped
                };
              }
            }
          }
          function unstable_unsubscribe(subscriber) {
            {
              subscribers.delete(subscriber);
              if (subscribers.size === 0) {
                exports.__subscriberRef.current = null;
              }
            }
          }
          function onInteractionTraced(interaction) {
            var didCatchError = false;
            var caughtError = null;
            subscribers.forEach(function(subscriber) {
              try {
                subscriber.onInteractionTraced(interaction);
              } catch (error) {
                if (!didCatchError) {
                  didCatchError = true;
                  caughtError = error;
                }
              }
            });
            if (didCatchError) {
              throw caughtError;
            }
          }
          function onInteractionScheduledWorkCompleted(interaction) {
            var didCatchError = false;
            var caughtError = null;
            subscribers.forEach(function(subscriber) {
              try {
                subscriber.onInteractionScheduledWorkCompleted(interaction);
              } catch (error) {
                if (!didCatchError) {
                  didCatchError = true;
                  caughtError = error;
                }
              }
            });
            if (didCatchError) {
              throw caughtError;
            }
          }
          function onWorkScheduled(interactions, threadID) {
            var didCatchError = false;
            var caughtError = null;
            subscribers.forEach(function(subscriber) {
              try {
                subscriber.onWorkScheduled(interactions, threadID);
              } catch (error) {
                if (!didCatchError) {
                  didCatchError = true;
                  caughtError = error;
                }
              }
            });
            if (didCatchError) {
              throw caughtError;
            }
          }
          function onWorkStarted(interactions, threadID) {
            var didCatchError = false;
            var caughtError = null;
            subscribers.forEach(function(subscriber) {
              try {
                subscriber.onWorkStarted(interactions, threadID);
              } catch (error) {
                if (!didCatchError) {
                  didCatchError = true;
                  caughtError = error;
                }
              }
            });
            if (didCatchError) {
              throw caughtError;
            }
          }
          function onWorkStopped(interactions, threadID) {
            var didCatchError = false;
            var caughtError = null;
            subscribers.forEach(function(subscriber) {
              try {
                subscriber.onWorkStopped(interactions, threadID);
              } catch (error) {
                if (!didCatchError) {
                  didCatchError = true;
                  caughtError = error;
                }
              }
            });
            if (didCatchError) {
              throw caughtError;
            }
          }
          function onWorkCanceled(interactions, threadID) {
            var didCatchError = false;
            var caughtError = null;
            subscribers.forEach(function(subscriber) {
              try {
                subscriber.onWorkCanceled(interactions, threadID);
              } catch (error) {
                if (!didCatchError) {
                  didCatchError = true;
                  caughtError = error;
                }
              }
            });
            if (didCatchError) {
              throw caughtError;
            }
          }
          exports.unstable_clear = unstable_clear;
          exports.unstable_getCurrent = unstable_getCurrent;
          exports.unstable_getThreadID = unstable_getThreadID;
          exports.unstable_subscribe = unstable_subscribe;
          exports.unstable_trace = unstable_trace;
          exports.unstable_unsubscribe = unstable_unsubscribe;
          exports.unstable_wrap = unstable_wrap;
        })();
      }
    }
  });

  // node_modules/scheduler/tracing.js
  var require_tracing = __commonJS({
    "node_modules/scheduler/tracing.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_scheduler_tracing_development();
      }
    }
  });

  // node_modules/react-dom/cjs/react-dom.development.js
  var require_react_dom_development = __commonJS({
    "node_modules/react-dom/cjs/react-dom.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          var React215 = require_react();
          var _assign = require_object_assign();
          var Scheduler = require_scheduler();
          var tracing = require_tracing();
          var ReactSharedInternals = React215.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
          function warn(format) {
            {
              for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                args[_key - 1] = arguments[_key];
              }
              printWarning("warn", format, args);
            }
          }
          function error(format) {
            {
              for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
                args[_key2 - 1] = arguments[_key2];
              }
              printWarning("error", format, args);
            }
          }
          function printWarning(level, format, args) {
            {
              var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
              var stack = ReactDebugCurrentFrame2.getStackAddendum();
              if (stack !== "") {
                format += "%s";
                args = args.concat([stack]);
              }
              var argsWithFormat = args.map(function(item) {
                return "" + item;
              });
              argsWithFormat.unshift("Warning: " + format);
              Function.prototype.apply.call(console[level], console, argsWithFormat);
            }
          }
          if (!React215) {
            {
              throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.");
            }
          }
          var FunctionComponent = 0;
          var ClassComponent = 1;
          var IndeterminateComponent = 2;
          var HostRoot = 3;
          var HostPortal = 4;
          var HostComponent = 5;
          var HostText = 6;
          var Fragment6 = 7;
          var Mode = 8;
          var ContextConsumer = 9;
          var ContextProvider = 10;
          var ForwardRef = 11;
          var Profiler = 12;
          var SuspenseComponent = 13;
          var MemoComponent = 14;
          var SimpleMemoComponent = 15;
          var LazyComponent = 16;
          var IncompleteClassComponent = 17;
          var DehydratedFragment = 18;
          var SuspenseListComponent = 19;
          var FundamentalComponent = 20;
          var ScopeComponent = 21;
          var Block = 22;
          var OffscreenComponent = 23;
          var LegacyHiddenComponent = 24;
          var enableProfilerTimer = true;
          var enableFundamentalAPI = false;
          var enableNewReconciler = false;
          var warnAboutStringRefs = false;
          var allNativeEvents = /* @__PURE__ */ new Set();
          var registrationNameDependencies = {};
          var possibleRegistrationNames = {};
          function registerTwoPhaseEvent(registrationName, dependencies) {
            registerDirectEvent(registrationName, dependencies);
            registerDirectEvent(registrationName + "Capture", dependencies);
          }
          function registerDirectEvent(registrationName, dependencies) {
            {
              if (registrationNameDependencies[registrationName]) {
                error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName);
              }
            }
            registrationNameDependencies[registrationName] = dependencies;
            {
              var lowerCasedName = registrationName.toLowerCase();
              possibleRegistrationNames[lowerCasedName] = registrationName;
              if (registrationName === "onDoubleClick") {
                possibleRegistrationNames.ondblclick = registrationName;
              }
            }
            for (var i = 0; i < dependencies.length; i++) {
              allNativeEvents.add(dependencies[i]);
            }
          }
          var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
          var RESERVED = 0;
          var STRING = 1;
          var BOOLEANISH_STRING = 2;
          var BOOLEAN = 3;
          var OVERLOADED_BOOLEAN = 4;
          var NUMERIC = 5;
          var POSITIVE_NUMERIC = 6;
          var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
          var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
          var ROOT_ATTRIBUTE_NAME = "data-reactroot";
          var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$");
          var hasOwnProperty = Object.prototype.hasOwnProperty;
          var illegalAttributeNameCache = {};
          var validatedAttributeNameCache = {};
          function isAttributeNameSafe(attributeName) {
            if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
              return true;
            }
            if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
              return false;
            }
            if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
              validatedAttributeNameCache[attributeName] = true;
              return true;
            }
            illegalAttributeNameCache[attributeName] = true;
            {
              error("Invalid attribute name: `%s`", attributeName);
            }
            return false;
          }
          function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
            if (propertyInfo !== null) {
              return propertyInfo.type === RESERVED;
            }
            if (isCustomComponentTag) {
              return false;
            }
            if (name.length > 2 && (name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N")) {
              return true;
            }
            return false;
          }
          function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
            if (propertyInfo !== null && propertyInfo.type === RESERVED) {
              return false;
            }
            switch (typeof value) {
              case "function":
              case "symbol":
                return true;
              case "boolean": {
                if (isCustomComponentTag) {
                  return false;
                }
                if (propertyInfo !== null) {
                  return !propertyInfo.acceptsBooleans;
                } else {
                  var prefix2 = name.toLowerCase().slice(0, 5);
                  return prefix2 !== "data-" && prefix2 !== "aria-";
                }
              }
              default:
                return false;
            }
          }
          function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
            if (value === null || typeof value === "undefined") {
              return true;
            }
            if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
              return true;
            }
            if (isCustomComponentTag) {
              return false;
            }
            if (propertyInfo !== null) {
              switch (propertyInfo.type) {
                case BOOLEAN:
                  return !value;
                case OVERLOADED_BOOLEAN:
                  return value === false;
                case NUMERIC:
                  return isNaN(value);
                case POSITIVE_NUMERIC:
                  return isNaN(value) || value < 1;
              }
            }
            return false;
          }
          function getPropertyInfo(name) {
            return properties.hasOwnProperty(name) ? properties[name] : null;
          }
          function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) {
            this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
            this.attributeName = attributeName;
            this.attributeNamespace = attributeNamespace;
            this.mustUseProperty = mustUseProperty;
            this.propertyName = name;
            this.type = type;
            this.sanitizeURL = sanitizeURL2;
            this.removeEmptyString = removeEmptyString;
          }
          var properties = {};
          var reservedProps = [
            "children",
            "dangerouslySetInnerHTML",
            "defaultValue",
            "defaultChecked",
            "innerHTML",
            "suppressContentEditableWarning",
            "suppressHydrationWarning",
            "style"
          ];
          reservedProps.forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              RESERVED,
              false,
              name,
              null,
              false,
              false
            );
          });
          [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref) {
            var name = _ref[0], attributeName = _ref[1];
            properties[name] = new PropertyInfoRecord(
              name,
              STRING,
              false,
              attributeName,
              null,
              false,
              false
            );
          });
          ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              BOOLEANISH_STRING,
              false,
              name.toLowerCase(),
              null,
              false,
              false
            );
          });
          ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              BOOLEANISH_STRING,
              false,
              name,
              null,
              false,
              false
            );
          });
          [
            "allowFullScreen",
            "async",
            "autoFocus",
            "autoPlay",
            "controls",
            "default",
            "defer",
            "disabled",
            "disablePictureInPicture",
            "disableRemotePlayback",
            "formNoValidate",
            "hidden",
            "loop",
            "noModule",
            "noValidate",
            "open",
            "playsInline",
            "readOnly",
            "required",
            "reversed",
            "scoped",
            "seamless",
            "itemScope"
          ].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              BOOLEAN,
              false,
              name.toLowerCase(),
              null,
              false,
              false
            );
          });
          [
            "checked",
            "multiple",
            "muted",
            "selected"
          ].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              BOOLEAN,
              true,
              name,
              null,
              false,
              false
            );
          });
          [
            "capture",
            "download"
          ].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              OVERLOADED_BOOLEAN,
              false,
              name,
              null,
              false,
              false
            );
          });
          [
            "cols",
            "rows",
            "size",
            "span"
          ].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              POSITIVE_NUMERIC,
              false,
              name,
              null,
              false,
              false
            );
          });
          ["rowSpan", "start"].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              NUMERIC,
              false,
              name.toLowerCase(),
              null,
              false,
              false
            );
          });
          var CAMELIZE = /[\-\:]([a-z])/g;
          var capitalize = function(token) {
            return token[1].toUpperCase();
          };
          [
            "accent-height",
            "alignment-baseline",
            "arabic-form",
            "baseline-shift",
            "cap-height",
            "clip-path",
            "clip-rule",
            "color-interpolation",
            "color-interpolation-filters",
            "color-profile",
            "color-rendering",
            "dominant-baseline",
            "enable-background",
            "fill-opacity",
            "fill-rule",
            "flood-color",
            "flood-opacity",
            "font-family",
            "font-size",
            "font-size-adjust",
            "font-stretch",
            "font-style",
            "font-variant",
            "font-weight",
            "glyph-name",
            "glyph-orientation-horizontal",
            "glyph-orientation-vertical",
            "horiz-adv-x",
            "horiz-origin-x",
            "image-rendering",
            "letter-spacing",
            "lighting-color",
            "marker-end",
            "marker-mid",
            "marker-start",
            "overline-position",
            "overline-thickness",
            "paint-order",
            "panose-1",
            "pointer-events",
            "rendering-intent",
            "shape-rendering",
            "stop-color",
            "stop-opacity",
            "strikethrough-position",
            "strikethrough-thickness",
            "stroke-dasharray",
            "stroke-dashoffset",
            "stroke-linecap",
            "stroke-linejoin",
            "stroke-miterlimit",
            "stroke-opacity",
            "stroke-width",
            "text-anchor",
            "text-decoration",
            "text-rendering",
            "underline-position",
            "underline-thickness",
            "unicode-bidi",
            "unicode-range",
            "units-per-em",
            "v-alphabetic",
            "v-hanging",
            "v-ideographic",
            "v-mathematical",
            "vector-effect",
            "vert-adv-y",
            "vert-origin-x",
            "vert-origin-y",
            "word-spacing",
            "writing-mode",
            "xmlns:xlink",
            "x-height"
          ].forEach(function(attributeName) {
            var name = attributeName.replace(CAMELIZE, capitalize);
            properties[name] = new PropertyInfoRecord(
              name,
              STRING,
              false,
              attributeName,
              null,
              false,
              false
            );
          });
          [
            "xlink:actuate",
            "xlink:arcrole",
            "xlink:role",
            "xlink:show",
            "xlink:title",
            "xlink:type"
          ].forEach(function(attributeName) {
            var name = attributeName.replace(CAMELIZE, capitalize);
            properties[name] = new PropertyInfoRecord(
              name,
              STRING,
              false,
              attributeName,
              "http://www.w3.org/1999/xlink",
              false,
              false
            );
          });
          [
            "xml:base",
            "xml:lang",
            "xml:space"
          ].forEach(function(attributeName) {
            var name = attributeName.replace(CAMELIZE, capitalize);
            properties[name] = new PropertyInfoRecord(
              name,
              STRING,
              false,
              attributeName,
              "http://www.w3.org/XML/1998/namespace",
              false,
              false
            );
          });
          ["tabIndex", "crossOrigin"].forEach(function(attributeName) {
            properties[attributeName] = new PropertyInfoRecord(
              attributeName,
              STRING,
              false,
              attributeName.toLowerCase(),
              null,
              false,
              false
            );
          });
          var xlinkHref = "xlinkHref";
          properties[xlinkHref] = new PropertyInfoRecord(
            "xlinkHref",
            STRING,
            false,
            "xlink:href",
            "http://www.w3.org/1999/xlink",
            true,
            false
          );
          ["src", "href", "action", "formAction"].forEach(function(attributeName) {
            properties[attributeName] = new PropertyInfoRecord(
              attributeName,
              STRING,
              false,
              attributeName.toLowerCase(),
              null,
              true,
              true
            );
          });
          var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
          var didWarn = false;
          function sanitizeURL(url) {
            {
              if (!didWarn && isJavaScriptProtocol.test(url)) {
                didWarn = true;
                error("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url));
              }
            }
          }
          function getValueForProperty(node, name, expected, propertyInfo) {
            {
              if (propertyInfo.mustUseProperty) {
                var propertyName = propertyInfo.propertyName;
                return node[propertyName];
              } else {
                if (propertyInfo.sanitizeURL) {
                  sanitizeURL("" + expected);
                }
                var attributeName = propertyInfo.attributeName;
                var stringValue = null;
                if (propertyInfo.type === OVERLOADED_BOOLEAN) {
                  if (node.hasAttribute(attributeName)) {
                    var value = node.getAttribute(attributeName);
                    if (value === "") {
                      return true;
                    }
                    if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
                      return value;
                    }
                    if (value === "" + expected) {
                      return expected;
                    }
                    return value;
                  }
                } else if (node.hasAttribute(attributeName)) {
                  if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
                    return node.getAttribute(attributeName);
                  }
                  if (propertyInfo.type === BOOLEAN) {
                    return expected;
                  }
                  stringValue = node.getAttribute(attributeName);
                }
                if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
                  return stringValue === null ? expected : stringValue;
                } else if (stringValue === "" + expected) {
                  return expected;
                } else {
                  return stringValue;
                }
              }
            }
          }
          function getValueForAttribute(node, name, expected) {
            {
              if (!isAttributeNameSafe(name)) {
                return;
              }
              if (isOpaqueHydratingObject(expected)) {
                return expected;
              }
              if (!node.hasAttribute(name)) {
                return expected === void 0 ? void 0 : null;
              }
              var value = node.getAttribute(name);
              if (value === "" + expected) {
                return expected;
              }
              return value;
            }
          }
          function setValueForProperty(node, name, value, isCustomComponentTag) {
            var propertyInfo = getPropertyInfo(name);
            if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
              return;
            }
            if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
              value = null;
            }
            if (isCustomComponentTag || propertyInfo === null) {
              if (isAttributeNameSafe(name)) {
                var _attributeName = name;
                if (value === null) {
                  node.removeAttribute(_attributeName);
                } else {
                  node.setAttribute(_attributeName, "" + value);
                }
              }
              return;
            }
            var mustUseProperty = propertyInfo.mustUseProperty;
            if (mustUseProperty) {
              var propertyName = propertyInfo.propertyName;
              if (value === null) {
                var type = propertyInfo.type;
                node[propertyName] = type === BOOLEAN ? false : "";
              } else {
                node[propertyName] = value;
              }
              return;
            }
            var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace;
            if (value === null) {
              node.removeAttribute(attributeName);
            } else {
              var _type = propertyInfo.type;
              var attributeValue;
              if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
                attributeValue = "";
              } else {
                {
                  attributeValue = "" + value;
                }
                if (propertyInfo.sanitizeURL) {
                  sanitizeURL(attributeValue.toString());
                }
              }
              if (attributeNamespace) {
                node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
              } else {
                node.setAttribute(attributeName, attributeValue);
              }
            }
          }
          var REACT_ELEMENT_TYPE = 60103;
          var REACT_PORTAL_TYPE = 60106;
          var REACT_FRAGMENT_TYPE = 60107;
          var REACT_STRICT_MODE_TYPE = 60108;
          var REACT_PROFILER_TYPE = 60114;
          var REACT_PROVIDER_TYPE = 60109;
          var REACT_CONTEXT_TYPE = 60110;
          var REACT_FORWARD_REF_TYPE = 60112;
          var REACT_SUSPENSE_TYPE = 60113;
          var REACT_SUSPENSE_LIST_TYPE = 60120;
          var REACT_MEMO_TYPE = 60115;
          var REACT_LAZY_TYPE = 60116;
          var REACT_BLOCK_TYPE = 60121;
          var REACT_SERVER_BLOCK_TYPE = 60122;
          var REACT_FUNDAMENTAL_TYPE = 60117;
          var REACT_SCOPE_TYPE = 60119;
          var REACT_OPAQUE_ID_TYPE = 60128;
          var REACT_DEBUG_TRACING_MODE_TYPE = 60129;
          var REACT_OFFSCREEN_TYPE = 60130;
          var REACT_LEGACY_HIDDEN_TYPE = 60131;
          if (typeof Symbol === "function" && Symbol.for) {
            var symbolFor = Symbol.for;
            REACT_ELEMENT_TYPE = symbolFor("react.element");
            REACT_PORTAL_TYPE = symbolFor("react.portal");
            REACT_FRAGMENT_TYPE = symbolFor("react.fragment");
            REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode");
            REACT_PROFILER_TYPE = symbolFor("react.profiler");
            REACT_PROVIDER_TYPE = symbolFor("react.provider");
            REACT_CONTEXT_TYPE = symbolFor("react.context");
            REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref");
            REACT_SUSPENSE_TYPE = symbolFor("react.suspense");
            REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list");
            REACT_MEMO_TYPE = symbolFor("react.memo");
            REACT_LAZY_TYPE = symbolFor("react.lazy");
            REACT_BLOCK_TYPE = symbolFor("react.block");
            REACT_SERVER_BLOCK_TYPE = symbolFor("react.server.block");
            REACT_FUNDAMENTAL_TYPE = symbolFor("react.fundamental");
            REACT_SCOPE_TYPE = symbolFor("react.scope");
            REACT_OPAQUE_ID_TYPE = symbolFor("react.opaque.id");
            REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
            REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen");
            REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
          }
          var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
          var FAUX_ITERATOR_SYMBOL = "@@iterator";
          function getIteratorFn(maybeIterable) {
            if (maybeIterable === null || typeof maybeIterable !== "object") {
              return null;
            }
            var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
            if (typeof maybeIterator === "function") {
              return maybeIterator;
            }
            return null;
          }
          var disabledDepth = 0;
          var prevLog;
          var prevInfo;
          var prevWarn;
          var prevError;
          var prevGroup;
          var prevGroupCollapsed;
          var prevGroupEnd;
          function disabledLog() {
          }
          disabledLog.__reactDisabledLog = true;
          function disableLogs() {
            {
              if (disabledDepth === 0) {
                prevLog = console.log;
                prevInfo = console.info;
                prevWarn = console.warn;
                prevError = console.error;
                prevGroup = console.group;
                prevGroupCollapsed = console.groupCollapsed;
                prevGroupEnd = console.groupEnd;
                var props = {
                  configurable: true,
                  enumerable: true,
                  value: disabledLog,
                  writable: true
                };
                Object.defineProperties(console, {
                  info: props,
                  log: props,
                  warn: props,
                  error: props,
                  group: props,
                  groupCollapsed: props,
                  groupEnd: props
                });
              }
              disabledDepth++;
            }
          }
          function reenableLogs() {
            {
              disabledDepth--;
              if (disabledDepth === 0) {
                var props = {
                  configurable: true,
                  enumerable: true,
                  writable: true
                };
                Object.defineProperties(console, {
                  log: _assign({}, props, {
                    value: prevLog
                  }),
                  info: _assign({}, props, {
                    value: prevInfo
                  }),
                  warn: _assign({}, props, {
                    value: prevWarn
                  }),
                  error: _assign({}, props, {
                    value: prevError
                  }),
                  group: _assign({}, props, {
                    value: prevGroup
                  }),
                  groupCollapsed: _assign({}, props, {
                    value: prevGroupCollapsed
                  }),
                  groupEnd: _assign({}, props, {
                    value: prevGroupEnd
                  })
                });
              }
              if (disabledDepth < 0) {
                error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
              }
            }
          }
          var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
          var prefix;
          function describeBuiltInComponentFrame(name, source, ownerFn) {
            {
              if (prefix === void 0) {
                try {
                  throw Error();
                } catch (x) {
                  var match = x.stack.trim().match(/\n( *(at )?)/);
                  prefix = match && match[1] || "";
                }
              }
              return "\n" + prefix + name;
            }
          }
          var reentry = false;
          var componentFrameCache;
          {
            var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
            componentFrameCache = new PossiblyWeakMap();
          }
          function describeNativeComponentFrame(fn, construct) {
            if (!fn || reentry) {
              return "";
            }
            {
              var frame = componentFrameCache.get(fn);
              if (frame !== void 0) {
                return frame;
              }
            }
            var control;
            reentry = true;
            var previousPrepareStackTrace = Error.prepareStackTrace;
            Error.prepareStackTrace = void 0;
            var previousDispatcher;
            {
              previousDispatcher = ReactCurrentDispatcher.current;
              ReactCurrentDispatcher.current = null;
              disableLogs();
            }
            try {
              if (construct) {
                var Fake = function() {
                  throw Error();
                };
                Object.defineProperty(Fake.prototype, "props", {
                  set: function() {
                    throw Error();
                  }
                });
                if (typeof Reflect === "object" && Reflect.construct) {
                  try {
                    Reflect.construct(Fake, []);
                  } catch (x) {
                    control = x;
                  }
                  Reflect.construct(fn, [], Fake);
                } else {
                  try {
                    Fake.call();
                  } catch (x) {
                    control = x;
                  }
                  fn.call(Fake.prototype);
                }
              } else {
                try {
                  throw Error();
                } catch (x) {
                  control = x;
                }
                fn();
              }
            } catch (sample) {
              if (sample && control && typeof sample.stack === "string") {
                var sampleLines = sample.stack.split("\n");
                var controlLines = control.stack.split("\n");
                var s = sampleLines.length - 1;
                var c = controlLines.length - 1;
                while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
                  c--;
                }
                for (; s >= 1 && c >= 0; s--, c--) {
                  if (sampleLines[s] !== controlLines[c]) {
                    if (s !== 1 || c !== 1) {
                      do {
                        s--;
                        c--;
                        if (c < 0 || sampleLines[s] !== controlLines[c]) {
                          var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
                          {
                            if (typeof fn === "function") {
                              componentFrameCache.set(fn, _frame);
                            }
                          }
                          return _frame;
                        }
                      } while (s >= 1 && c >= 0);
                    }
                    break;
                  }
                }
              }
            } finally {
              reentry = false;
              {
                ReactCurrentDispatcher.current = previousDispatcher;
                reenableLogs();
              }
              Error.prepareStackTrace = previousPrepareStackTrace;
            }
            var name = fn ? fn.displayName || fn.name : "";
            var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
            {
              if (typeof fn === "function") {
                componentFrameCache.set(fn, syntheticFrame);
              }
            }
            return syntheticFrame;
          }
          function describeClassComponentFrame(ctor, source, ownerFn) {
            {
              return describeNativeComponentFrame(ctor, true);
            }
          }
          function describeFunctionComponentFrame(fn, source, ownerFn) {
            {
              return describeNativeComponentFrame(fn, false);
            }
          }
          function shouldConstruct(Component2) {
            var prototype = Component2.prototype;
            return !!(prototype && prototype.isReactComponent);
          }
          function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
            if (type == null) {
              return "";
            }
            if (typeof type === "function") {
              {
                return describeNativeComponentFrame(type, shouldConstruct(type));
              }
            }
            if (typeof type === "string") {
              return describeBuiltInComponentFrame(type);
            }
            switch (type) {
              case REACT_SUSPENSE_TYPE:
                return describeBuiltInComponentFrame("Suspense");
              case REACT_SUSPENSE_LIST_TYPE:
                return describeBuiltInComponentFrame("SuspenseList");
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_FORWARD_REF_TYPE:
                  return describeFunctionComponentFrame(type.render);
                case REACT_MEMO_TYPE:
                  return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
                case REACT_BLOCK_TYPE:
                  return describeFunctionComponentFrame(type._render);
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
                  } catch (x) {
                  }
                }
              }
            }
            return "";
          }
          function describeFiber(fiber) {
            var owner = fiber._debugOwner ? fiber._debugOwner.type : null;
            var source = fiber._debugSource;
            switch (fiber.tag) {
              case HostComponent:
                return describeBuiltInComponentFrame(fiber.type);
              case LazyComponent:
                return describeBuiltInComponentFrame("Lazy");
              case SuspenseComponent:
                return describeBuiltInComponentFrame("Suspense");
              case SuspenseListComponent:
                return describeBuiltInComponentFrame("SuspenseList");
              case FunctionComponent:
              case IndeterminateComponent:
              case SimpleMemoComponent:
                return describeFunctionComponentFrame(fiber.type);
              case ForwardRef:
                return describeFunctionComponentFrame(fiber.type.render);
              case Block:
                return describeFunctionComponentFrame(fiber.type._render);
              case ClassComponent:
                return describeClassComponentFrame(fiber.type);
              default:
                return "";
            }
          }
          function getStackByFiberInDevAndProd(workInProgress2) {
            try {
              var info = "";
              var node = workInProgress2;
              do {
                info += describeFiber(node);
                node = node.return;
              } while (node);
              return info;
            } catch (x) {
              return "\nError generating stack: " + x.message + "\n" + x.stack;
            }
          }
          function getWrappedName(outerType, innerType, wrapperName) {
            var functionName = innerType.displayName || innerType.name || "";
            return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
          }
          function getContextName(type) {
            return type.displayName || "Context";
          }
          function getComponentName(type) {
            if (type == null) {
              return null;
            }
            {
              if (typeof type.tag === "number") {
                error("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue.");
              }
            }
            if (typeof type === "function") {
              return type.displayName || type.name || null;
            }
            if (typeof type === "string") {
              return type;
            }
            switch (type) {
              case REACT_FRAGMENT_TYPE:
                return "Fragment";
              case REACT_PORTAL_TYPE:
                return "Portal";
              case REACT_PROFILER_TYPE:
                return "Profiler";
              case REACT_STRICT_MODE_TYPE:
                return "StrictMode";
              case REACT_SUSPENSE_TYPE:
                return "Suspense";
              case REACT_SUSPENSE_LIST_TYPE:
                return "SuspenseList";
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_CONTEXT_TYPE:
                  var context = type;
                  return getContextName(context) + ".Consumer";
                case REACT_PROVIDER_TYPE:
                  var provider = type;
                  return getContextName(provider._context) + ".Provider";
                case REACT_FORWARD_REF_TYPE:
                  return getWrappedName(type, type.render, "ForwardRef");
                case REACT_MEMO_TYPE:
                  return getComponentName(type.type);
                case REACT_BLOCK_TYPE:
                  return getComponentName(type._render);
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return getComponentName(init(payload));
                  } catch (x) {
                    return null;
                  }
                }
              }
            }
            return null;
          }
          var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
          var current = null;
          var isRendering = false;
          function getCurrentFiberOwnerNameInDevOrNull() {
            {
              if (current === null) {
                return null;
              }
              var owner = current._debugOwner;
              if (owner !== null && typeof owner !== "undefined") {
                return getComponentName(owner.type);
              }
            }
            return null;
          }
          function getCurrentFiberStackInDev() {
            {
              if (current === null) {
                return "";
              }
              return getStackByFiberInDevAndProd(current);
            }
          }
          function resetCurrentFiber() {
            {
              ReactDebugCurrentFrame.getCurrentStack = null;
              current = null;
              isRendering = false;
            }
          }
          function setCurrentFiber(fiber) {
            {
              ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
              current = fiber;
              isRendering = false;
            }
          }
          function setIsRendering(rendering) {
            {
              isRendering = rendering;
            }
          }
          function getIsRendering() {
            {
              return isRendering;
            }
          }
          function toString(value) {
            return "" + value;
          }
          function getToStringValue(value) {
            switch (typeof value) {
              case "boolean":
              case "number":
              case "object":
              case "string":
              case "undefined":
                return value;
              default:
                return "";
            }
          }
          var hasReadOnlyValue = {
            button: true,
            checkbox: true,
            image: true,
            hidden: true,
            radio: true,
            reset: true,
            submit: true
          };
          function checkControlledValueProps(tagName, props) {
            {
              if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {
                error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.");
              }
              if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {
                error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.");
              }
            }
          }
          function isCheckable(elem) {
            var type = elem.type;
            var nodeName = elem.nodeName;
            return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio");
          }
          function getTracker(node) {
            return node._valueTracker;
          }
          function detachTracker(node) {
            node._valueTracker = null;
          }
          function getValueFromNode(node) {
            var value = "";
            if (!node) {
              return value;
            }
            if (isCheckable(node)) {
              value = node.checked ? "true" : "false";
            } else {
              value = node.value;
            }
            return value;
          }
          function trackValueOnNode(node) {
            var valueField = isCheckable(node) ? "checked" : "value";
            var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
            var currentValue = "" + node[valueField];
            if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") {
              return;
            }
            var get2 = descriptor.get, set2 = descriptor.set;
            Object.defineProperty(node, valueField, {
              configurable: true,
              get: function() {
                return get2.call(this);
              },
              set: function(value) {
                currentValue = "" + value;
                set2.call(this, value);
              }
            });
            Object.defineProperty(node, valueField, {
              enumerable: descriptor.enumerable
            });
            var tracker = {
              getValue: function() {
                return currentValue;
              },
              setValue: function(value) {
                currentValue = "" + value;
              },
              stopTracking: function() {
                detachTracker(node);
                delete node[valueField];
              }
            };
            return tracker;
          }
          function track(node) {
            if (getTracker(node)) {
              return;
            }
            node._valueTracker = trackValueOnNode(node);
          }
          function updateValueIfChanged(node) {
            if (!node) {
              return false;
            }
            var tracker = getTracker(node);
            if (!tracker) {
              return true;
            }
            var lastValue = tracker.getValue();
            var nextValue = getValueFromNode(node);
            if (nextValue !== lastValue) {
              tracker.setValue(nextValue);
              return true;
            }
            return false;
          }
          function getActiveElement(doc) {
            doc = doc || (typeof document !== "undefined" ? document : void 0);
            if (typeof doc === "undefined") {
              return null;
            }
            try {
              return doc.activeElement || doc.body;
            } catch (e) {
              return doc.body;
            }
          }
          var didWarnValueDefaultValue = false;
          var didWarnCheckedDefaultChecked = false;
          var didWarnControlledToUncontrolled = false;
          var didWarnUncontrolledToControlled = false;
          function isControlled(props) {
            var usesChecked = props.type === "checkbox" || props.type === "radio";
            return usesChecked ? props.checked != null : props.value != null;
          }
          function getHostProps(element, props) {
            var node = element;
            var checked = props.checked;
            var hostProps = _assign({}, props, {
              defaultChecked: void 0,
              defaultValue: void 0,
              value: void 0,
              checked: checked != null ? checked : node._wrapperState.initialChecked
            });
            return hostProps;
          }
          function initWrapperState(element, props) {
            {
              checkControlledValueProps("input", props);
              if (props.checked !== void 0 && props.defaultChecked !== void 0 && !didWarnCheckedDefaultChecked) {
                error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
                didWarnCheckedDefaultChecked = true;
              }
              if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue) {
                error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
                didWarnValueDefaultValue = true;
              }
            }
            var node = element;
            var defaultValue = props.defaultValue == null ? "" : props.defaultValue;
            node._wrapperState = {
              initialChecked: props.checked != null ? props.checked : props.defaultChecked,
              initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
              controlled: isControlled(props)
            };
          }
          function updateChecked(element, props) {
            var node = element;
            var checked = props.checked;
            if (checked != null) {
              setValueForProperty(node, "checked", checked, false);
            }
          }
          function updateWrapper(element, props) {
            var node = element;
            {
              var controlled = isControlled(props);
              if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
                error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
                didWarnUncontrolledToControlled = true;
              }
              if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
                error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
                didWarnControlledToUncontrolled = true;
              }
            }
            updateChecked(element, props);
            var value = getToStringValue(props.value);
            var type = props.type;
            if (value != null) {
              if (type === "number") {
                if (value === 0 && node.value === "" || node.value != value) {
                  node.value = toString(value);
                }
              } else if (node.value !== toString(value)) {
                node.value = toString(value);
              }
            } else if (type === "submit" || type === "reset") {
              node.removeAttribute("value");
              return;
            }
            {
              if (props.hasOwnProperty("value")) {
                setDefaultValue(node, props.type, value);
              } else if (props.hasOwnProperty("defaultValue")) {
                setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
              }
            }
            {
              if (props.checked == null && props.defaultChecked != null) {
                node.defaultChecked = !!props.defaultChecked;
              }
            }
          }
          function postMountWrapper(element, props, isHydrating2) {
            var node = element;
            if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) {
              var type = props.type;
              var isButton = type === "submit" || type === "reset";
              if (isButton && (props.value === void 0 || props.value === null)) {
                return;
              }
              var initialValue = toString(node._wrapperState.initialValue);
              if (!isHydrating2) {
                {
                  if (initialValue !== node.value) {
                    node.value = initialValue;
                  }
                }
              }
              {
                node.defaultValue = initialValue;
              }
            }
            var name = node.name;
            if (name !== "") {
              node.name = "";
            }
            {
              node.defaultChecked = !node.defaultChecked;
              node.defaultChecked = !!node._wrapperState.initialChecked;
            }
            if (name !== "") {
              node.name = name;
            }
          }
          function restoreControlledState(element, props) {
            var node = element;
            updateWrapper(node, props);
            updateNamedCousins(node, props);
          }
          function updateNamedCousins(rootNode, props) {
            var name = props.name;
            if (props.type === "radio" && name != null) {
              var queryRoot = rootNode;
              while (queryRoot.parentNode) {
                queryRoot = queryRoot.parentNode;
              }
              var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name) + '][type="radio"]');
              for (var i = 0; i < group.length; i++) {
                var otherNode = group[i];
                if (otherNode === rootNode || otherNode.form !== rootNode.form) {
                  continue;
                }
                var otherProps = getFiberCurrentPropsFromNode(otherNode);
                if (!otherProps) {
                  {
                    throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
                  }
                }
                updateValueIfChanged(otherNode);
                updateWrapper(otherNode, otherProps);
              }
            }
          }
          function setDefaultValue(node, type, value) {
            if (type !== "number" || getActiveElement(node.ownerDocument) !== node) {
              if (value == null) {
                node.defaultValue = toString(node._wrapperState.initialValue);
              } else if (node.defaultValue !== toString(value)) {
                node.defaultValue = toString(value);
              }
            }
          }
          var didWarnSelectedSetOnOption = false;
          var didWarnInvalidChild = false;
          function flattenChildren(children) {
            var content = "";
            React215.Children.forEach(children, function(child) {
              if (child == null) {
                return;
              }
              content += child;
            });
            return content;
          }
          function validateProps(element, props) {
            {
              if (typeof props.children === "object" && props.children !== null) {
                React215.Children.forEach(props.children, function(child) {
                  if (child == null) {
                    return;
                  }
                  if (typeof child === "string" || typeof child === "number") {
                    return;
                  }
                  if (typeof child.type !== "string") {
                    return;
                  }
                  if (!didWarnInvalidChild) {
                    didWarnInvalidChild = true;
                    error("Only strings and numbers are supported as <option> children.");
                  }
                });
              }
              if (props.selected != null && !didWarnSelectedSetOnOption) {
                error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>.");
                didWarnSelectedSetOnOption = true;
              }
            }
          }
          function postMountWrapper$1(element, props) {
            if (props.value != null) {
              element.setAttribute("value", toString(getToStringValue(props.value)));
            }
          }
          function getHostProps$1(element, props) {
            var hostProps = _assign({
              children: void 0
            }, props);
            var content = flattenChildren(props.children);
            if (content) {
              hostProps.children = content;
            }
            return hostProps;
          }
          var didWarnValueDefaultValue$1;
          {
            didWarnValueDefaultValue$1 = false;
          }
          function getDeclarationErrorAddendum() {
            var ownerName = getCurrentFiberOwnerNameInDevOrNull();
            if (ownerName) {
              return "\n\nCheck the render method of `" + ownerName + "`.";
            }
            return "";
          }
          var valuePropNames = ["value", "defaultValue"];
          function checkSelectPropTypes(props) {
            {
              checkControlledValueProps("select", props);
              for (var i = 0; i < valuePropNames.length; i++) {
                var propName = valuePropNames[i];
                if (props[propName] == null) {
                  continue;
                }
                var isArray2 = Array.isArray(props[propName]);
                if (props.multiple && !isArray2) {
                  error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", propName, getDeclarationErrorAddendum());
                } else if (!props.multiple && isArray2) {
                  error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", propName, getDeclarationErrorAddendum());
                }
              }
            }
          }
          function updateOptions(node, multiple, propValue, setDefaultSelected) {
            var options2 = node.options;
            if (multiple) {
              var selectedValues = propValue;
              var selectedValue = {};
              for (var i = 0; i < selectedValues.length; i++) {
                selectedValue["$" + selectedValues[i]] = true;
              }
              for (var _i = 0; _i < options2.length; _i++) {
                var selected = selectedValue.hasOwnProperty("$" + options2[_i].value);
                if (options2[_i].selected !== selected) {
                  options2[_i].selected = selected;
                }
                if (selected && setDefaultSelected) {
                  options2[_i].defaultSelected = true;
                }
              }
            } else {
              var _selectedValue = toString(getToStringValue(propValue));
              var defaultSelected = null;
              for (var _i2 = 0; _i2 < options2.length; _i2++) {
                if (options2[_i2].value === _selectedValue) {
                  options2[_i2].selected = true;
                  if (setDefaultSelected) {
                    options2[_i2].defaultSelected = true;
                  }
                  return;
                }
                if (defaultSelected === null && !options2[_i2].disabled) {
                  defaultSelected = options2[_i2];
                }
              }
              if (defaultSelected !== null) {
                defaultSelected.selected = true;
              }
            }
          }
          function getHostProps$2(element, props) {
            return _assign({}, props, {
              value: void 0
            });
          }
          function initWrapperState$1(element, props) {
            var node = element;
            {
              checkSelectPropTypes(props);
            }
            node._wrapperState = {
              wasMultiple: !!props.multiple
            };
            {
              if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue$1) {
                error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components");
                didWarnValueDefaultValue$1 = true;
              }
            }
          }
          function postMountWrapper$2(element, props) {
            var node = element;
            node.multiple = !!props.multiple;
            var value = props.value;
            if (value != null) {
              updateOptions(node, !!props.multiple, value, false);
            } else if (props.defaultValue != null) {
              updateOptions(node, !!props.multiple, props.defaultValue, true);
            }
          }
          function postUpdateWrapper(element, props) {
            var node = element;
            var wasMultiple = node._wrapperState.wasMultiple;
            node._wrapperState.wasMultiple = !!props.multiple;
            var value = props.value;
            if (value != null) {
              updateOptions(node, !!props.multiple, value, false);
            } else if (wasMultiple !== !!props.multiple) {
              if (props.defaultValue != null) {
                updateOptions(node, !!props.multiple, props.defaultValue, true);
              } else {
                updateOptions(node, !!props.multiple, props.multiple ? [] : "", false);
              }
            }
          }
          function restoreControlledState$1(element, props) {
            var node = element;
            var value = props.value;
            if (value != null) {
              updateOptions(node, !!props.multiple, value, false);
            }
          }
          var didWarnValDefaultVal = false;
          function getHostProps$3(element, props) {
            var node = element;
            if (!(props.dangerouslySetInnerHTML == null)) {
              {
                throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
              }
            }
            var hostProps = _assign({}, props, {
              value: void 0,
              defaultValue: void 0,
              children: toString(node._wrapperState.initialValue)
            });
            return hostProps;
          }
          function initWrapperState$2(element, props) {
            var node = element;
            {
              checkControlledValueProps("textarea", props);
              if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValDefaultVal) {
                error("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component");
                didWarnValDefaultVal = true;
              }
            }
            var initialValue = props.value;
            if (initialValue == null) {
              var children = props.children, defaultValue = props.defaultValue;
              if (children != null) {
                {
                  error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");
                }
                {
                  if (!(defaultValue == null)) {
                    {
                      throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
                    }
                  }
                  if (Array.isArray(children)) {
                    if (!(children.length <= 1)) {
                      {
                        throw Error("<textarea> can only have at most one child.");
                      }
                    }
                    children = children[0];
                  }
                  defaultValue = children;
                }
              }
              if (defaultValue == null) {
                defaultValue = "";
              }
              initialValue = defaultValue;
            }
            node._wrapperState = {
              initialValue: getToStringValue(initialValue)
            };
          }
          function updateWrapper$1(element, props) {
            var node = element;
            var value = getToStringValue(props.value);
            var defaultValue = getToStringValue(props.defaultValue);
            if (value != null) {
              var newValue = toString(value);
              if (newValue !== node.value) {
                node.value = newValue;
              }
              if (props.defaultValue == null && node.defaultValue !== newValue) {
                node.defaultValue = newValue;
              }
            }
            if (defaultValue != null) {
              node.defaultValue = toString(defaultValue);
            }
          }
          function postMountWrapper$3(element, props) {
            var node = element;
            var textContent = node.textContent;
            if (textContent === node._wrapperState.initialValue) {
              if (textContent !== "" && textContent !== null) {
                node.value = textContent;
              }
            }
          }
          function restoreControlledState$2(element, props) {
            updateWrapper$1(element, props);
          }
          var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
          var MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
          var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
          var Namespaces = {
            html: HTML_NAMESPACE,
            mathml: MATH_NAMESPACE,
            svg: SVG_NAMESPACE
          };
          function getIntrinsicNamespace(type) {
            switch (type) {
              case "svg":
                return SVG_NAMESPACE;
              case "math":
                return MATH_NAMESPACE;
              default:
                return HTML_NAMESPACE;
            }
          }
          function getChildNamespace(parentNamespace, type) {
            if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
              return getIntrinsicNamespace(type);
            }
            if (parentNamespace === SVG_NAMESPACE && type === "foreignObject") {
              return HTML_NAMESPACE;
            }
            return parentNamespace;
          }
          var createMicrosoftUnsafeLocalFunction = function(func) {
            if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction) {
              return function(arg0, arg1, arg2, arg3) {
                MSApp.execUnsafeLocalFunction(function() {
                  return func(arg0, arg1, arg2, arg3);
                });
              };
            } else {
              return func;
            }
          };
          var reusableSVGContainer;
          var setInnerHTML = createMicrosoftUnsafeLocalFunction(function(node, html) {
            if (node.namespaceURI === Namespaces.svg) {
              if (!("innerHTML" in node)) {
                reusableSVGContainer = reusableSVGContainer || document.createElement("div");
                reusableSVGContainer.innerHTML = "<svg>" + html.valueOf().toString() + "</svg>";
                var svgNode = reusableSVGContainer.firstChild;
                while (node.firstChild) {
                  node.removeChild(node.firstChild);
                }
                while (svgNode.firstChild) {
                  node.appendChild(svgNode.firstChild);
                }
                return;
              }
            }
            node.innerHTML = html;
          });
          var ELEMENT_NODE = 1;
          var TEXT_NODE = 3;
          var COMMENT_NODE = 8;
          var DOCUMENT_NODE = 9;
          var DOCUMENT_FRAGMENT_NODE = 11;
          var setTextContent = function(node, text) {
            if (text) {
              var firstChild = node.firstChild;
              if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
                firstChild.nodeValue = text;
                return;
              }
            }
            node.textContent = text;
          };
          var shorthandToLonghand = {
            animation: ["animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationTimingFunction"],
            background: ["backgroundAttachment", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize"],
            backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
            border: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderTopColor", "borderTopStyle", "borderTopWidth"],
            borderBlockEnd: ["borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth"],
            borderBlockStart: ["borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth"],
            borderBottom: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth"],
            borderColor: ["borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor"],
            borderImage: ["borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth"],
            borderInlineEnd: ["borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth"],
            borderInlineStart: ["borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth"],
            borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
            borderRadius: ["borderBottomLeftRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderTopRightRadius"],
            borderRight: ["borderRightColor", "borderRightStyle", "borderRightWidth"],
            borderStyle: ["borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderTopStyle"],
            borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
            borderWidth: ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth"],
            columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
            columns: ["columnCount", "columnWidth"],
            flex: ["flexBasis", "flexGrow", "flexShrink"],
            flexFlow: ["flexDirection", "flexWrap"],
            font: ["fontFamily", "fontFeatureSettings", "fontKerning", "fontLanguageOverride", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontWeight", "lineHeight"],
            fontVariant: ["fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition"],
            gap: ["columnGap", "rowGap"],
            grid: ["gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
            gridArea: ["gridColumnEnd", "gridColumnStart", "gridRowEnd", "gridRowStart"],
            gridColumn: ["gridColumnEnd", "gridColumnStart"],
            gridColumnGap: ["columnGap"],
            gridGap: ["columnGap", "rowGap"],
            gridRow: ["gridRowEnd", "gridRowStart"],
            gridRowGap: ["rowGap"],
            gridTemplate: ["gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
            listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
            margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
            marker: ["markerEnd", "markerMid", "markerStart"],
            mask: ["maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPositionX", "maskPositionY", "maskRepeat", "maskSize"],
            maskPosition: ["maskPositionX", "maskPositionY"],
            outline: ["outlineColor", "outlineStyle", "outlineWidth"],
            overflow: ["overflowX", "overflowY"],
            padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
            placeContent: ["alignContent", "justifyContent"],
            placeItems: ["alignItems", "justifyItems"],
            placeSelf: ["alignSelf", "justifySelf"],
            textDecoration: ["textDecorationColor", "textDecorationLine", "textDecorationStyle"],
            textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
            transition: ["transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction"],
            wordWrap: ["overflowWrap"]
          };
          var isUnitlessNumber = {
            animationIterationCount: true,
            borderImageOutset: true,
            borderImageSlice: true,
            borderImageWidth: true,
            boxFlex: true,
            boxFlexGroup: true,
            boxOrdinalGroup: true,
            columnCount: true,
            columns: true,
            flex: true,
            flexGrow: true,
            flexPositive: true,
            flexShrink: true,
            flexNegative: true,
            flexOrder: true,
            gridArea: true,
            gridRow: true,
            gridRowEnd: true,
            gridRowSpan: true,
            gridRowStart: true,
            gridColumn: true,
            gridColumnEnd: true,
            gridColumnSpan: true,
            gridColumnStart: true,
            fontWeight: true,
            lineClamp: true,
            lineHeight: true,
            opacity: true,
            order: true,
            orphans: true,
            tabSize: true,
            widows: true,
            zIndex: true,
            zoom: true,
            fillOpacity: true,
            floodOpacity: true,
            stopOpacity: true,
            strokeDasharray: true,
            strokeDashoffset: true,
            strokeMiterlimit: true,
            strokeOpacity: true,
            strokeWidth: true
          };
          function prefixKey(prefix2, key2) {
            return prefix2 + key2.charAt(0).toUpperCase() + key2.substring(1);
          }
          var prefixes = ["Webkit", "ms", "Moz", "O"];
          Object.keys(isUnitlessNumber).forEach(function(prop) {
            prefixes.forEach(function(prefix2) {
              isUnitlessNumber[prefixKey(prefix2, prop)] = isUnitlessNumber[prop];
            });
          });
          function dangerousStyleValue(name, value, isCustomProperty) {
            var isEmpty = value == null || typeof value === "boolean" || value === "";
            if (isEmpty) {
              return "";
            }
            if (!isCustomProperty && typeof value === "number" && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
              return value + "px";
            }
            return ("" + value).trim();
          }
          var uppercasePattern = /([A-Z])/g;
          var msPattern = /^ms-/;
          function hyphenateStyleName(name) {
            return name.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern, "-ms-");
          }
          var warnValidStyle = function() {
          };
          {
            var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
            var msPattern$1 = /^-ms-/;
            var hyphenPattern = /-(.)/g;
            var badStyleValueWithSemicolonPattern = /;\s*$/;
            var warnedStyleNames = {};
            var warnedStyleValues = {};
            var warnedForNaNValue = false;
            var warnedForInfinityValue = false;
            var camelize = function(string) {
              return string.replace(hyphenPattern, function(_, character) {
                return character.toUpperCase();
              });
            };
            var warnHyphenatedStyleName = function(name) {
              if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
                return;
              }
              warnedStyleNames[name] = true;
              error(
                "Unsupported style property %s. Did you mean %s?",
                name,
                camelize(name.replace(msPattern$1, "ms-"))
              );
            };
            var warnBadVendoredStyleName = function(name) {
              if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
                return;
              }
              warnedStyleNames[name] = true;
              error("Unsupported vendor-prefixed style property %s. Did you mean %s?", name, name.charAt(0).toUpperCase() + name.slice(1));
            };
            var warnStyleValueWithSemicolon = function(name, value) {
              if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
                return;
              }
              warnedStyleValues[value] = true;
              error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, name, value.replace(badStyleValueWithSemicolonPattern, ""));
            };
            var warnStyleValueIsNaN = function(name, value) {
              if (warnedForNaNValue) {
                return;
              }
              warnedForNaNValue = true;
              error("`NaN` is an invalid value for the `%s` css style property.", name);
            };
            var warnStyleValueIsInfinity = function(name, value) {
              if (warnedForInfinityValue) {
                return;
              }
              warnedForInfinityValue = true;
              error("`Infinity` is an invalid value for the `%s` css style property.", name);
            };
            warnValidStyle = function(name, value) {
              if (name.indexOf("-") > -1) {
                warnHyphenatedStyleName(name);
              } else if (badVendoredStyleNamePattern.test(name)) {
                warnBadVendoredStyleName(name);
              } else if (badStyleValueWithSemicolonPattern.test(value)) {
                warnStyleValueWithSemicolon(name, value);
              }
              if (typeof value === "number") {
                if (isNaN(value)) {
                  warnStyleValueIsNaN(name, value);
                } else if (!isFinite(value)) {
                  warnStyleValueIsInfinity(name, value);
                }
              }
            };
          }
          var warnValidStyle$1 = warnValidStyle;
          function createDangerousStringForStyles(styles) {
            {
              var serialized = "";
              var delimiter = "";
              for (var styleName in styles) {
                if (!styles.hasOwnProperty(styleName)) {
                  continue;
                }
                var styleValue = styles[styleName];
                if (styleValue != null) {
                  var isCustomProperty = styleName.indexOf("--") === 0;
                  serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ":";
                  serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
                  delimiter = ";";
                }
              }
              return serialized || null;
            }
          }
          function setValueForStyles(node, styles) {
            var style3 = node.style;
            for (var styleName in styles) {
              if (!styles.hasOwnProperty(styleName)) {
                continue;
              }
              var isCustomProperty = styleName.indexOf("--") === 0;
              {
                if (!isCustomProperty) {
                  warnValidStyle$1(styleName, styles[styleName]);
                }
              }
              var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
              if (styleName === "float") {
                styleName = "cssFloat";
              }
              if (isCustomProperty) {
                style3.setProperty(styleName, styleValue);
              } else {
                style3[styleName] = styleValue;
              }
            }
          }
          function isValueEmpty(value) {
            return value == null || typeof value === "boolean" || value === "";
          }
          function expandShorthandMap(styles) {
            var expanded = {};
            for (var key2 in styles) {
              var longhands = shorthandToLonghand[key2] || [key2];
              for (var i = 0; i < longhands.length; i++) {
                expanded[longhands[i]] = key2;
              }
            }
            return expanded;
          }
          function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
            {
              if (!nextStyles) {
                return;
              }
              var expandedUpdates = expandShorthandMap(styleUpdates);
              var expandedStyles = expandShorthandMap(nextStyles);
              var warnedAbout = {};
              for (var key2 in expandedUpdates) {
                var originalKey = expandedUpdates[key2];
                var correctOriginalKey = expandedStyles[key2];
                if (correctOriginalKey && originalKey !== correctOriginalKey) {
                  var warningKey = originalKey + "," + correctOriginalKey;
                  if (warnedAbout[warningKey]) {
                    continue;
                  }
                  warnedAbout[warningKey] = true;
                  error("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", isValueEmpty(styleUpdates[originalKey]) ? "Removing" : "Updating", originalKey, correctOriginalKey);
                }
              }
            }
          }
          var omittedCloseTags = {
            area: true,
            base: true,
            br: true,
            col: true,
            embed: true,
            hr: true,
            img: true,
            input: true,
            keygen: true,
            link: true,
            meta: true,
            param: true,
            source: true,
            track: true,
            wbr: true
          };
          var voidElementTags = _assign({
            menuitem: true
          }, omittedCloseTags);
          var HTML = "__html";
          function assertValidProps(tag, props) {
            if (!props) {
              return;
            }
            if (voidElementTags[tag]) {
              if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
                {
                  throw Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
                }
              }
            }
            if (props.dangerouslySetInnerHTML != null) {
              if (!(props.children == null)) {
                {
                  throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
                }
              }
              if (!(typeof props.dangerouslySetInnerHTML === "object" && HTML in props.dangerouslySetInnerHTML)) {
                {
                  throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");
                }
              }
            }
            {
              if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
                error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.");
              }
            }
            if (!(props.style == null || typeof props.style === "object")) {
              {
                throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");
              }
            }
          }
          function isCustomComponent(tagName, props) {
            if (tagName.indexOf("-") === -1) {
              return typeof props.is === "string";
            }
            switch (tagName) {
              case "annotation-xml":
              case "color-profile":
              case "font-face":
              case "font-face-src":
              case "font-face-uri":
              case "font-face-format":
              case "font-face-name":
              case "missing-glyph":
                return false;
              default:
                return true;
            }
          }
          var possibleStandardNames = {
            accept: "accept",
            acceptcharset: "acceptCharset",
            "accept-charset": "acceptCharset",
            accesskey: "accessKey",
            action: "action",
            allowfullscreen: "allowFullScreen",
            alt: "alt",
            as: "as",
            async: "async",
            autocapitalize: "autoCapitalize",
            autocomplete: "autoComplete",
            autocorrect: "autoCorrect",
            autofocus: "autoFocus",
            autoplay: "autoPlay",
            autosave: "autoSave",
            capture: "capture",
            cellpadding: "cellPadding",
            cellspacing: "cellSpacing",
            challenge: "challenge",
            charset: "charSet",
            checked: "checked",
            children: "children",
            cite: "cite",
            class: "className",
            classid: "classID",
            classname: "className",
            cols: "cols",
            colspan: "colSpan",
            content: "content",
            contenteditable: "contentEditable",
            contextmenu: "contextMenu",
            controls: "controls",
            controlslist: "controlsList",
            coords: "coords",
            crossorigin: "crossOrigin",
            dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
            data: "data",
            datetime: "dateTime",
            default: "default",
            defaultchecked: "defaultChecked",
            defaultvalue: "defaultValue",
            defer: "defer",
            dir: "dir",
            disabled: "disabled",
            disablepictureinpicture: "disablePictureInPicture",
            disableremoteplayback: "disableRemotePlayback",
            download: "download",
            draggable: "draggable",
            enctype: "encType",
            enterkeyhint: "enterKeyHint",
            for: "htmlFor",
            form: "form",
            formmethod: "formMethod",
            formaction: "formAction",
            formenctype: "formEncType",
            formnovalidate: "formNoValidate",
            formtarget: "formTarget",
            frameborder: "frameBorder",
            headers: "headers",
            height: "height",
            hidden: "hidden",
            high: "high",
            href: "href",
            hreflang: "hrefLang",
            htmlfor: "htmlFor",
            httpequiv: "httpEquiv",
            "http-equiv": "httpEquiv",
            icon: "icon",
            id: "id",
            innerhtml: "innerHTML",
            inputmode: "inputMode",
            integrity: "integrity",
            is: "is",
            itemid: "itemID",
            itemprop: "itemProp",
            itemref: "itemRef",
            itemscope: "itemScope",
            itemtype: "itemType",
            keyparams: "keyParams",
            keytype: "keyType",
            kind: "kind",
            label: "label",
            lang: "lang",
            list: "list",
            loop: "loop",
            low: "low",
            manifest: "manifest",
            marginwidth: "marginWidth",
            marginheight: "marginHeight",
            max: "max",
            maxlength: "maxLength",
            media: "media",
            mediagroup: "mediaGroup",
            method: "method",
            min: "min",
            minlength: "minLength",
            multiple: "multiple",
            muted: "muted",
            name: "name",
            nomodule: "noModule",
            nonce: "nonce",
            novalidate: "noValidate",
            open: "open",
            optimum: "optimum",
            pattern: "pattern",
            placeholder: "placeholder",
            playsinline: "playsInline",
            poster: "poster",
            preload: "preload",
            profile: "profile",
            radiogroup: "radioGroup",
            readonly: "readOnly",
            referrerpolicy: "referrerPolicy",
            rel: "rel",
            required: "required",
            reversed: "reversed",
            role: "role",
            rows: "rows",
            rowspan: "rowSpan",
            sandbox: "sandbox",
            scope: "scope",
            scoped: "scoped",
            scrolling: "scrolling",
            seamless: "seamless",
            selected: "selected",
            shape: "shape",
            size: "size",
            sizes: "sizes",
            span: "span",
            spellcheck: "spellCheck",
            src: "src",
            srcdoc: "srcDoc",
            srclang: "srcLang",
            srcset: "srcSet",
            start: "start",
            step: "step",
            style: "style",
            summary: "summary",
            tabindex: "tabIndex",
            target: "target",
            title: "title",
            type: "type",
            usemap: "useMap",
            value: "value",
            width: "width",
            wmode: "wmode",
            wrap: "wrap",
            about: "about",
            accentheight: "accentHeight",
            "accent-height": "accentHeight",
            accumulate: "accumulate",
            additive: "additive",
            alignmentbaseline: "alignmentBaseline",
            "alignment-baseline": "alignmentBaseline",
            allowreorder: "allowReorder",
            alphabetic: "alphabetic",
            amplitude: "amplitude",
            arabicform: "arabicForm",
            "arabic-form": "arabicForm",
            ascent: "ascent",
            attributename: "attributeName",
            attributetype: "attributeType",
            autoreverse: "autoReverse",
            azimuth: "azimuth",
            basefrequency: "baseFrequency",
            baselineshift: "baselineShift",
            "baseline-shift": "baselineShift",
            baseprofile: "baseProfile",
            bbox: "bbox",
            begin: "begin",
            bias: "bias",
            by: "by",
            calcmode: "calcMode",
            capheight: "capHeight",
            "cap-height": "capHeight",
            clip: "clip",
            clippath: "clipPath",
            "clip-path": "clipPath",
            clippathunits: "clipPathUnits",
            cliprule: "clipRule",
            "clip-rule": "clipRule",
            color: "color",
            colorinterpolation: "colorInterpolation",
            "color-interpolation": "colorInterpolation",
            colorinterpolationfilters: "colorInterpolationFilters",
            "color-interpolation-filters": "colorInterpolationFilters",
            colorprofile: "colorProfile",
            "color-profile": "colorProfile",
            colorrendering: "colorRendering",
            "color-rendering": "colorRendering",
            contentscripttype: "contentScriptType",
            contentstyletype: "contentStyleType",
            cursor: "cursor",
            cx: "cx",
            cy: "cy",
            d: "d",
            datatype: "datatype",
            decelerate: "decelerate",
            descent: "descent",
            diffuseconstant: "diffuseConstant",
            direction: "direction",
            display: "display",
            divisor: "divisor",
            dominantbaseline: "dominantBaseline",
            "dominant-baseline": "dominantBaseline",
            dur: "dur",
            dx: "dx",
            dy: "dy",
            edgemode: "edgeMode",
            elevation: "elevation",
            enablebackground: "enableBackground",
            "enable-background": "enableBackground",
            end: "end",
            exponent: "exponent",
            externalresourcesrequired: "externalResourcesRequired",
            fill: "fill",
            fillopacity: "fillOpacity",
            "fill-opacity": "fillOpacity",
            fillrule: "fillRule",
            "fill-rule": "fillRule",
            filter: "filter",
            filterres: "filterRes",
            filterunits: "filterUnits",
            floodopacity: "floodOpacity",
            "flood-opacity": "floodOpacity",
            floodcolor: "floodColor",
            "flood-color": "floodColor",
            focusable: "focusable",
            fontfamily: "fontFamily",
            "font-family": "fontFamily",
            fontsize: "fontSize",
            "font-size": "fontSize",
            fontsizeadjust: "fontSizeAdjust",
            "font-size-adjust": "fontSizeAdjust",
            fontstretch: "fontStretch",
            "font-stretch": "fontStretch",
            fontstyle: "fontStyle",
            "font-style": "fontStyle",
            fontvariant: "fontVariant",
            "font-variant": "fontVariant",
            fontweight: "fontWeight",
            "font-weight": "fontWeight",
            format: "format",
            from: "from",
            fx: "fx",
            fy: "fy",
            g1: "g1",
            g2: "g2",
            glyphname: "glyphName",
            "glyph-name": "glyphName",
            glyphorientationhorizontal: "glyphOrientationHorizontal",
            "glyph-orientation-horizontal": "glyphOrientationHorizontal",
            glyphorientationvertical: "glyphOrientationVertical",
            "glyph-orientation-vertical": "glyphOrientationVertical",
            glyphref: "glyphRef",
            gradienttransform: "gradientTransform",
            gradientunits: "gradientUnits",
            hanging: "hanging",
            horizadvx: "horizAdvX",
            "horiz-adv-x": "horizAdvX",
            horizoriginx: "horizOriginX",
            "horiz-origin-x": "horizOriginX",
            ideographic: "ideographic",
            imagerendering: "imageRendering",
            "image-rendering": "imageRendering",
            in2: "in2",
            in: "in",
            inlist: "inlist",
            intercept: "intercept",
            k1: "k1",
            k2: "k2",
            k3: "k3",
            k4: "k4",
            k: "k",
            kernelmatrix: "kernelMatrix",
            kernelunitlength: "kernelUnitLength",
            kerning: "kerning",
            keypoints: "keyPoints",
            keysplines: "keySplines",
            keytimes: "keyTimes",
            lengthadjust: "lengthAdjust",
            letterspacing: "letterSpacing",
            "letter-spacing": "letterSpacing",
            lightingcolor: "lightingColor",
            "lighting-color": "lightingColor",
            limitingconeangle: "limitingConeAngle",
            local: "local",
            markerend: "markerEnd",
            "marker-end": "markerEnd",
            markerheight: "markerHeight",
            markermid: "markerMid",
            "marker-mid": "markerMid",
            markerstart: "markerStart",
            "marker-start": "markerStart",
            markerunits: "markerUnits",
            markerwidth: "markerWidth",
            mask: "mask",
            maskcontentunits: "maskContentUnits",
            maskunits: "maskUnits",
            mathematical: "mathematical",
            mode: "mode",
            numoctaves: "numOctaves",
            offset: "offset",
            opacity: "opacity",
            operator: "operator",
            order: "order",
            orient: "orient",
            orientation: "orientation",
            origin: "origin",
            overflow: "overflow",
            overlineposition: "overlinePosition",
            "overline-position": "overlinePosition",
            overlinethickness: "overlineThickness",
            "overline-thickness": "overlineThickness",
            paintorder: "paintOrder",
            "paint-order": "paintOrder",
            panose1: "panose1",
            "panose-1": "panose1",
            pathlength: "pathLength",
            patterncontentunits: "patternContentUnits",
            patterntransform: "patternTransform",
            patternunits: "patternUnits",
            pointerevents: "pointerEvents",
            "pointer-events": "pointerEvents",
            points: "points",
            pointsatx: "pointsAtX",
            pointsaty: "pointsAtY",
            pointsatz: "pointsAtZ",
            prefix: "prefix",
            preservealpha: "preserveAlpha",
            preserveaspectratio: "preserveAspectRatio",
            primitiveunits: "primitiveUnits",
            property: "property",
            r: "r",
            radius: "radius",
            refx: "refX",
            refy: "refY",
            renderingintent: "renderingIntent",
            "rendering-intent": "renderingIntent",
            repeatcount: "repeatCount",
            repeatdur: "repeatDur",
            requiredextensions: "requiredExtensions",
            requiredfeatures: "requiredFeatures",
            resource: "resource",
            restart: "restart",
            result: "result",
            results: "results",
            rotate: "rotate",
            rx: "rx",
            ry: "ry",
            scale: "scale",
            security: "security",
            seed: "seed",
            shaperendering: "shapeRendering",
            "shape-rendering": "shapeRendering",
            slope: "slope",
            spacing: "spacing",
            specularconstant: "specularConstant",
            specularexponent: "specularExponent",
            speed: "speed",
            spreadmethod: "spreadMethod",
            startoffset: "startOffset",
            stddeviation: "stdDeviation",
            stemh: "stemh",
            stemv: "stemv",
            stitchtiles: "stitchTiles",
            stopcolor: "stopColor",
            "stop-color": "stopColor",
            stopopacity: "stopOpacity",
            "stop-opacity": "stopOpacity",
            strikethroughposition: "strikethroughPosition",
            "strikethrough-position": "strikethroughPosition",
            strikethroughthickness: "strikethroughThickness",
            "strikethrough-thickness": "strikethroughThickness",
            string: "string",
            stroke: "stroke",
            strokedasharray: "strokeDasharray",
            "stroke-dasharray": "strokeDasharray",
            strokedashoffset: "strokeDashoffset",
            "stroke-dashoffset": "strokeDashoffset",
            strokelinecap: "strokeLinecap",
            "stroke-linecap": "strokeLinecap",
            strokelinejoin: "strokeLinejoin",
            "stroke-linejoin": "strokeLinejoin",
            strokemiterlimit: "strokeMiterlimit",
            "stroke-miterlimit": "strokeMiterlimit",
            strokewidth: "strokeWidth",
            "stroke-width": "strokeWidth",
            strokeopacity: "strokeOpacity",
            "stroke-opacity": "strokeOpacity",
            suppresscontenteditablewarning: "suppressContentEditableWarning",
            suppresshydrationwarning: "suppressHydrationWarning",
            surfacescale: "surfaceScale",
            systemlanguage: "systemLanguage",
            tablevalues: "tableValues",
            targetx: "targetX",
            targety: "targetY",
            textanchor: "textAnchor",
            "text-anchor": "textAnchor",
            textdecoration: "textDecoration",
            "text-decoration": "textDecoration",
            textlength: "textLength",
            textrendering: "textRendering",
            "text-rendering": "textRendering",
            to: "to",
            transform: "transform",
            typeof: "typeof",
            u1: "u1",
            u2: "u2",
            underlineposition: "underlinePosition",
            "underline-position": "underlinePosition",
            underlinethickness: "underlineThickness",
            "underline-thickness": "underlineThickness",
            unicode: "unicode",
            unicodebidi: "unicodeBidi",
            "unicode-bidi": "unicodeBidi",
            unicoderange: "unicodeRange",
            "unicode-range": "unicodeRange",
            unitsperem: "unitsPerEm",
            "units-per-em": "unitsPerEm",
            unselectable: "unselectable",
            valphabetic: "vAlphabetic",
            "v-alphabetic": "vAlphabetic",
            values: "values",
            vectoreffect: "vectorEffect",
            "vector-effect": "vectorEffect",
            version: "version",
            vertadvy: "vertAdvY",
            "vert-adv-y": "vertAdvY",
            vertoriginx: "vertOriginX",
            "vert-origin-x": "vertOriginX",
            vertoriginy: "vertOriginY",
            "vert-origin-y": "vertOriginY",
            vhanging: "vHanging",
            "v-hanging": "vHanging",
            videographic: "vIdeographic",
            "v-ideographic": "vIdeographic",
            viewbox: "viewBox",
            viewtarget: "viewTarget",
            visibility: "visibility",
            vmathematical: "vMathematical",
            "v-mathematical": "vMathematical",
            vocab: "vocab",
            widths: "widths",
            wordspacing: "wordSpacing",
            "word-spacing": "wordSpacing",
            writingmode: "writingMode",
            "writing-mode": "writingMode",
            x1: "x1",
            x2: "x2",
            x: "x",
            xchannelselector: "xChannelSelector",
            xheight: "xHeight",
            "x-height": "xHeight",
            xlinkactuate: "xlinkActuate",
            "xlink:actuate": "xlinkActuate",
            xlinkarcrole: "xlinkArcrole",
            "xlink:arcrole": "xlinkArcrole",
            xlinkhref: "xlinkHref",
            "xlink:href": "xlinkHref",
            xlinkrole: "xlinkRole",
            "xlink:role": "xlinkRole",
            xlinkshow: "xlinkShow",
            "xlink:show": "xlinkShow",
            xlinktitle: "xlinkTitle",
            "xlink:title": "xlinkTitle",
            xlinktype: "xlinkType",
            "xlink:type": "xlinkType",
            xmlbase: "xmlBase",
            "xml:base": "xmlBase",
            xmllang: "xmlLang",
            "xml:lang": "xmlLang",
            xmlns: "xmlns",
            "xml:space": "xmlSpace",
            xmlnsxlink: "xmlnsXlink",
            "xmlns:xlink": "xmlnsXlink",
            xmlspace: "xmlSpace",
            y1: "y1",
            y2: "y2",
            y: "y",
            ychannelselector: "yChannelSelector",
            z: "z",
            zoomandpan: "zoomAndPan"
          };
          var ariaProperties = {
            "aria-current": 0,
            "aria-details": 0,
            "aria-disabled": 0,
            "aria-hidden": 0,
            "aria-invalid": 0,
            "aria-keyshortcuts": 0,
            "aria-label": 0,
            "aria-roledescription": 0,
            "aria-autocomplete": 0,
            "aria-checked": 0,
            "aria-expanded": 0,
            "aria-haspopup": 0,
            "aria-level": 0,
            "aria-modal": 0,
            "aria-multiline": 0,
            "aria-multiselectable": 0,
            "aria-orientation": 0,
            "aria-placeholder": 0,
            "aria-pressed": 0,
            "aria-readonly": 0,
            "aria-required": 0,
            "aria-selected": 0,
            "aria-sort": 0,
            "aria-valuemax": 0,
            "aria-valuemin": 0,
            "aria-valuenow": 0,
            "aria-valuetext": 0,
            "aria-atomic": 0,
            "aria-busy": 0,
            "aria-live": 0,
            "aria-relevant": 0,
            "aria-dropeffect": 0,
            "aria-grabbed": 0,
            "aria-activedescendant": 0,
            "aria-colcount": 0,
            "aria-colindex": 0,
            "aria-colspan": 0,
            "aria-controls": 0,
            "aria-describedby": 0,
            "aria-errormessage": 0,
            "aria-flowto": 0,
            "aria-labelledby": 0,
            "aria-owns": 0,
            "aria-posinset": 0,
            "aria-rowcount": 0,
            "aria-rowindex": 0,
            "aria-rowspan": 0,
            "aria-setsize": 0
          };
          var warnedProperties = {};
          var rARIA = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
          var rARIACamel = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
          var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
          function validateProperty(tagName, name) {
            {
              if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {
                return true;
              }
              if (rARIACamel.test(name)) {
                var ariaName = "aria-" + name.slice(4).toLowerCase();
                var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;
                if (correctName == null) {
                  error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", name);
                  warnedProperties[name] = true;
                  return true;
                }
                if (name !== correctName) {
                  error("Invalid ARIA attribute `%s`. Did you mean `%s`?", name, correctName);
                  warnedProperties[name] = true;
                  return true;
                }
              }
              if (rARIA.test(name)) {
                var lowerCasedName = name.toLowerCase();
                var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
                if (standardName == null) {
                  warnedProperties[name] = true;
                  return false;
                }
                if (name !== standardName) {
                  error("Unknown ARIA attribute `%s`. Did you mean `%s`?", name, standardName);
                  warnedProperties[name] = true;
                  return true;
                }
              }
            }
            return true;
          }
          function warnInvalidARIAProps(type, props) {
            {
              var invalidProps = [];
              for (var key2 in props) {
                var isValid = validateProperty(type, key2);
                if (!isValid) {
                  invalidProps.push(key2);
                }
              }
              var unknownPropString = invalidProps.map(function(prop) {
                return "`" + prop + "`";
              }).join(", ");
              if (invalidProps.length === 1) {
                error("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
              } else if (invalidProps.length > 1) {
                error("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
              }
            }
          }
          function validateProperties(type, props) {
            if (isCustomComponent(type, props)) {
              return;
            }
            warnInvalidARIAProps(type, props);
          }
          var didWarnValueNull = false;
          function validateProperties$1(type, props) {
            {
              if (type !== "input" && type !== "textarea" && type !== "select") {
                return;
              }
              if (props != null && props.value === null && !didWarnValueNull) {
                didWarnValueNull = true;
                if (type === "select" && props.multiple) {
                  error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", type);
                } else {
                  error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", type);
                }
              }
            }
          }
          var validateProperty$1 = function() {
          };
          {
            var warnedProperties$1 = {};
            var _hasOwnProperty = Object.prototype.hasOwnProperty;
            var EVENT_NAME_REGEX = /^on./;
            var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
            var rARIA$1 = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
            var rARIACamel$1 = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
            validateProperty$1 = function(tagName, name, value, eventRegistry) {
              if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
                return true;
              }
              var lowerCasedName = name.toLowerCase();
              if (lowerCasedName === "onfocusin" || lowerCasedName === "onfocusout") {
                error("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React.");
                warnedProperties$1[name] = true;
                return true;
              }
              if (eventRegistry != null) {
                var registrationNameDependencies2 = eventRegistry.registrationNameDependencies, possibleRegistrationNames2 = eventRegistry.possibleRegistrationNames;
                if (registrationNameDependencies2.hasOwnProperty(name)) {
                  return true;
                }
                var registrationName = possibleRegistrationNames2.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames2[lowerCasedName] : null;
                if (registrationName != null) {
                  error("Invalid event handler property `%s`. Did you mean `%s`?", name, registrationName);
                  warnedProperties$1[name] = true;
                  return true;
                }
                if (EVENT_NAME_REGEX.test(name)) {
                  error("Unknown event handler property `%s`. It will be ignored.", name);
                  warnedProperties$1[name] = true;
                  return true;
                }
              } else if (EVENT_NAME_REGEX.test(name)) {
                if (INVALID_EVENT_NAME_REGEX.test(name)) {
                  error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", name);
                }
                warnedProperties$1[name] = true;
                return true;
              }
              if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
                return true;
              }
              if (lowerCasedName === "innerhtml") {
                error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`.");
                warnedProperties$1[name] = true;
                return true;
              }
              if (lowerCasedName === "aria") {
                error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead.");
                warnedProperties$1[name] = true;
                return true;
              }
              if (lowerCasedName === "is" && value !== null && value !== void 0 && typeof value !== "string") {
                error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", typeof value);
                warnedProperties$1[name] = true;
                return true;
              }
              if (typeof value === "number" && isNaN(value)) {
                error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", name);
                warnedProperties$1[name] = true;
                return true;
              }
              var propertyInfo = getPropertyInfo(name);
              var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
              if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
                var standardName = possibleStandardNames[lowerCasedName];
                if (standardName !== name) {
                  error("Invalid DOM property `%s`. Did you mean `%s`?", name, standardName);
                  warnedProperties$1[name] = true;
                  return true;
                }
              } else if (!isReserved && name !== lowerCasedName) {
                error("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", name, lowerCasedName);
                warnedProperties$1[name] = true;
                return true;
              }
              if (typeof value === "boolean" && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
                if (value) {
                  error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', value, name, name, value, name);
                } else {
                  error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
                }
                warnedProperties$1[name] = true;
                return true;
              }
              if (isReserved) {
                return true;
              }
              if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
                warnedProperties$1[name] = true;
                return false;
              }
              if ((value === "false" || value === "true") && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
                error("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", value, name, value === "false" ? "The browser will interpret it as a truthy value." : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
                warnedProperties$1[name] = true;
                return true;
              }
              return true;
            };
          }
          var warnUnknownProperties = function(type, props, eventRegistry) {
            {
              var unknownProps = [];
              for (var key2 in props) {
                var isValid = validateProperty$1(type, key2, props[key2], eventRegistry);
                if (!isValid) {
                  unknownProps.push(key2);
                }
              }
              var unknownPropString = unknownProps.map(function(prop) {
                return "`" + prop + "`";
              }).join(", ");
              if (unknownProps.length === 1) {
                error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
              } else if (unknownProps.length > 1) {
                error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
              }
            }
          };
          function validateProperties$2(type, props, eventRegistry) {
            if (isCustomComponent(type, props)) {
              return;
            }
            warnUnknownProperties(type, props, eventRegistry);
          }
          var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1;
          var IS_NON_DELEGATED = 1 << 1;
          var IS_CAPTURE_PHASE = 1 << 2;
          var IS_REPLAYED = 1 << 4;
          var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;
          function getEventTarget(nativeEvent) {
            var target = nativeEvent.target || nativeEvent.srcElement || window;
            if (target.correspondingUseElement) {
              target = target.correspondingUseElement;
            }
            return target.nodeType === TEXT_NODE ? target.parentNode : target;
          }
          var restoreImpl = null;
          var restoreTarget = null;
          var restoreQueue = null;
          function restoreStateOfTarget(target) {
            var internalInstance = getInstanceFromNode(target);
            if (!internalInstance) {
              return;
            }
            if (!(typeof restoreImpl === "function")) {
              {
                throw Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            var stateNode = internalInstance.stateNode;
            if (stateNode) {
              var _props = getFiberCurrentPropsFromNode(stateNode);
              restoreImpl(internalInstance.stateNode, internalInstance.type, _props);
            }
          }
          function setRestoreImplementation(impl) {
            restoreImpl = impl;
          }
          function enqueueStateRestore(target) {
            if (restoreTarget) {
              if (restoreQueue) {
                restoreQueue.push(target);
              } else {
                restoreQueue = [target];
              }
            } else {
              restoreTarget = target;
            }
          }
          function needsStateRestore() {
            return restoreTarget !== null || restoreQueue !== null;
          }
          function restoreStateIfNeeded() {
            if (!restoreTarget) {
              return;
            }
            var target = restoreTarget;
            var queuedTargets = restoreQueue;
            restoreTarget = null;
            restoreQueue = null;
            restoreStateOfTarget(target);
            if (queuedTargets) {
              for (var i = 0; i < queuedTargets.length; i++) {
                restoreStateOfTarget(queuedTargets[i]);
              }
            }
          }
          var batchedUpdatesImpl = function(fn, bookkeeping) {
            return fn(bookkeeping);
          };
          var discreteUpdatesImpl = function(fn, a, b, c, d) {
            return fn(a, b, c, d);
          };
          var flushDiscreteUpdatesImpl = function() {
          };
          var batchedEventUpdatesImpl = batchedUpdatesImpl;
          var isInsideEventHandler = false;
          var isBatchingEventUpdates = false;
          function finishEventHandler() {
            var controlledComponentsHavePendingUpdates = needsStateRestore();
            if (controlledComponentsHavePendingUpdates) {
              flushDiscreteUpdatesImpl();
              restoreStateIfNeeded();
            }
          }
          function batchedUpdates(fn, bookkeeping) {
            if (isInsideEventHandler) {
              return fn(bookkeeping);
            }
            isInsideEventHandler = true;
            try {
              return batchedUpdatesImpl(fn, bookkeeping);
            } finally {
              isInsideEventHandler = false;
              finishEventHandler();
            }
          }
          function batchedEventUpdates(fn, a, b) {
            if (isBatchingEventUpdates) {
              return fn(a, b);
            }
            isBatchingEventUpdates = true;
            try {
              return batchedEventUpdatesImpl(fn, a, b);
            } finally {
              isBatchingEventUpdates = false;
              finishEventHandler();
            }
          }
          function discreteUpdates(fn, a, b, c, d) {
            var prevIsInsideEventHandler = isInsideEventHandler;
            isInsideEventHandler = true;
            try {
              return discreteUpdatesImpl(fn, a, b, c, d);
            } finally {
              isInsideEventHandler = prevIsInsideEventHandler;
              if (!isInsideEventHandler) {
                finishEventHandler();
              }
            }
          }
          function flushDiscreteUpdatesIfNeeded(timeStamp) {
            {
              if (!isInsideEventHandler) {
                flushDiscreteUpdatesImpl();
              }
            }
          }
          function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {
            batchedUpdatesImpl = _batchedUpdatesImpl;
            discreteUpdatesImpl = _discreteUpdatesImpl;
            flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;
            batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
          }
          function isInteractive(tag) {
            return tag === "button" || tag === "input" || tag === "select" || tag === "textarea";
          }
          function shouldPreventMouseEvent(name, type, props) {
            switch (name) {
              case "onClick":
              case "onClickCapture":
              case "onDoubleClick":
              case "onDoubleClickCapture":
              case "onMouseDown":
              case "onMouseDownCapture":
              case "onMouseMove":
              case "onMouseMoveCapture":
              case "onMouseUp":
              case "onMouseUpCapture":
              case "onMouseEnter":
                return !!(props.disabled && isInteractive(type));
              default:
                return false;
            }
          }
          function getListener(inst, registrationName) {
            var stateNode = inst.stateNode;
            if (stateNode === null) {
              return null;
            }
            var props = getFiberCurrentPropsFromNode(stateNode);
            if (props === null) {
              return null;
            }
            var listener = props[registrationName];
            if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
              return null;
            }
            if (!(!listener || typeof listener === "function")) {
              {
                throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type.");
              }
            }
            return listener;
          }
          var passiveBrowserEventsSupported = false;
          if (canUseDOM) {
            try {
              var options = {};
              Object.defineProperty(options, "passive", {
                get: function() {
                  passiveBrowserEventsSupported = true;
                }
              });
              window.addEventListener("test", options, options);
              window.removeEventListener("test", options, options);
            } catch (e) {
              passiveBrowserEventsSupported = false;
            }
          }
          function invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) {
            var funcArgs = Array.prototype.slice.call(arguments, 3);
            try {
              func.apply(context, funcArgs);
            } catch (error2) {
              this.onError(error2);
            }
          }
          var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
          {
            if (typeof window !== "undefined" && typeof window.dispatchEvent === "function" && typeof document !== "undefined" && typeof document.createEvent === "function") {
              var fakeNode = document.createElement("react");
              invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) {
                if (!(typeof document !== "undefined")) {
                  {
                    throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
                  }
                }
                var evt = document.createEvent("Event");
                var didCall = false;
                var didError = true;
                var windowEvent = window.event;
                var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, "event");
                function restoreAfterDispatch() {
                  fakeNode.removeEventListener(evtType, callCallback2, false);
                  if (typeof window.event !== "undefined" && window.hasOwnProperty("event")) {
                    window.event = windowEvent;
                  }
                }
                var funcArgs = Array.prototype.slice.call(arguments, 3);
                function callCallback2() {
                  didCall = true;
                  restoreAfterDispatch();
                  func.apply(context, funcArgs);
                  didError = false;
                }
                var error2;
                var didSetError = false;
                var isCrossOriginError = false;
                function handleWindowError(event) {
                  error2 = event.error;
                  didSetError = true;
                  if (error2 === null && event.colno === 0 && event.lineno === 0) {
                    isCrossOriginError = true;
                  }
                  if (event.defaultPrevented) {
                    if (error2 != null && typeof error2 === "object") {
                      try {
                        error2._suppressLogging = true;
                      } catch (inner) {
                      }
                    }
                  }
                }
                var evtType = "react-" + (name ? name : "invokeguardedcallback");
                window.addEventListener("error", handleWindowError);
                fakeNode.addEventListener(evtType, callCallback2, false);
                evt.initEvent(evtType, false, false);
                fakeNode.dispatchEvent(evt);
                if (windowEventDescriptor) {
                  Object.defineProperty(window, "event", windowEventDescriptor);
                }
                if (didCall && didError) {
                  if (!didSetError) {
                    error2 = new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`);
                  } else if (isCrossOriginError) {
                    error2 = new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.");
                  }
                  this.onError(error2);
                }
                window.removeEventListener("error", handleWindowError);
                if (!didCall) {
                  restoreAfterDispatch();
                  return invokeGuardedCallbackProd.apply(this, arguments);
                }
              };
            }
          }
          var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
          var hasError = false;
          var caughtError = null;
          var hasRethrowError = false;
          var rethrowError = null;
          var reporter = {
            onError: function(error2) {
              hasError = true;
              caughtError = error2;
            }
          };
          function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
            hasError = false;
            caughtError = null;
            invokeGuardedCallbackImpl$1.apply(reporter, arguments);
          }
          function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
            invokeGuardedCallback.apply(this, arguments);
            if (hasError) {
              var error2 = clearCaughtError();
              if (!hasRethrowError) {
                hasRethrowError = true;
                rethrowError = error2;
              }
            }
          }
          function rethrowCaughtError() {
            if (hasRethrowError) {
              var error2 = rethrowError;
              hasRethrowError = false;
              rethrowError = null;
              throw error2;
            }
          }
          function hasCaughtError() {
            return hasError;
          }
          function clearCaughtError() {
            if (hasError) {
              var error2 = caughtError;
              hasError = false;
              caughtError = null;
              return error2;
            } else {
              {
                {
                  throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
            }
          }
          function get(key2) {
            return key2._reactInternals;
          }
          function has(key2) {
            return key2._reactInternals !== void 0;
          }
          function set(key2, value) {
            key2._reactInternals = value;
          }
          var NoFlags = 0;
          var PerformedWork = 1;
          var Placement = 2;
          var Update = 4;
          var PlacementAndUpdate = 6;
          var Deletion = 8;
          var ContentReset = 16;
          var Callback = 32;
          var DidCapture = 64;
          var Ref = 128;
          var Snapshot = 256;
          var Passive = 512;
          var PassiveUnmountPendingDev = 8192;
          var Hydrating = 1024;
          var HydratingAndUpdate = 1028;
          var LifecycleEffectMask = 932;
          var HostEffectMask = 2047;
          var Incomplete = 2048;
          var ShouldCapture = 4096;
          var ForceUpdateForLegacySuspense = 16384;
          var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
          function getNearestMountedFiber(fiber) {
            var node = fiber;
            var nearestMounted = fiber;
            if (!fiber.alternate) {
              var nextNode = node;
              do {
                node = nextNode;
                if ((node.flags & (Placement | Hydrating)) !== NoFlags) {
                  nearestMounted = node.return;
                }
                nextNode = node.return;
              } while (nextNode);
            } else {
              while (node.return) {
                node = node.return;
              }
            }
            if (node.tag === HostRoot) {
              return nearestMounted;
            }
            return null;
          }
          function getSuspenseInstanceFromFiber(fiber) {
            if (fiber.tag === SuspenseComponent) {
              var suspenseState = fiber.memoizedState;
              if (suspenseState === null) {
                var current2 = fiber.alternate;
                if (current2 !== null) {
                  suspenseState = current2.memoizedState;
                }
              }
              if (suspenseState !== null) {
                return suspenseState.dehydrated;
              }
            }
            return null;
          }
          function getContainerFromFiber(fiber) {
            return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
          }
          function isFiberMounted(fiber) {
            return getNearestMountedFiber(fiber) === fiber;
          }
          function isMounted(component) {
            {
              var owner = ReactCurrentOwner.current;
              if (owner !== null && owner.tag === ClassComponent) {
                var ownerFiber = owner;
                var instance = ownerFiber.stateNode;
                if (!instance._warnedAboutRefsInRender) {
                  error("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentName(ownerFiber.type) || "A component");
                }
                instance._warnedAboutRefsInRender = true;
              }
            }
            var fiber = get(component);
            if (!fiber) {
              return false;
            }
            return getNearestMountedFiber(fiber) === fiber;
          }
          function assertIsMounted(fiber) {
            if (!(getNearestMountedFiber(fiber) === fiber)) {
              {
                throw Error("Unable to find node on an unmounted component.");
              }
            }
          }
          function findCurrentFiberUsingSlowPath(fiber) {
            var alternate = fiber.alternate;
            if (!alternate) {
              var nearestMounted = getNearestMountedFiber(fiber);
              if (!(nearestMounted !== null)) {
                {
                  throw Error("Unable to find node on an unmounted component.");
                }
              }
              if (nearestMounted !== fiber) {
                return null;
              }
              return fiber;
            }
            var a = fiber;
            var b = alternate;
            while (true) {
              var parentA = a.return;
              if (parentA === null) {
                break;
              }
              var parentB = parentA.alternate;
              if (parentB === null) {
                var nextParent = parentA.return;
                if (nextParent !== null) {
                  a = b = nextParent;
                  continue;
                }
                break;
              }
              if (parentA.child === parentB.child) {
                var child = parentA.child;
                while (child) {
                  if (child === a) {
                    assertIsMounted(parentA);
                    return fiber;
                  }
                  if (child === b) {
                    assertIsMounted(parentA);
                    return alternate;
                  }
                  child = child.sibling;
                }
                {
                  {
                    throw Error("Unable to find node on an unmounted component.");
                  }
                }
              }
              if (a.return !== b.return) {
                a = parentA;
                b = parentB;
              } else {
                var didFindChild = false;
                var _child = parentA.child;
                while (_child) {
                  if (_child === a) {
                    didFindChild = true;
                    a = parentA;
                    b = parentB;
                    break;
                  }
                  if (_child === b) {
                    didFindChild = true;
                    b = parentA;
                    a = parentB;
                    break;
                  }
                  _child = _child.sibling;
                }
                if (!didFindChild) {
                  _child = parentB.child;
                  while (_child) {
                    if (_child === a) {
                      didFindChild = true;
                      a = parentB;
                      b = parentA;
                      break;
                    }
                    if (_child === b) {
                      didFindChild = true;
                      b = parentB;
                      a = parentA;
                      break;
                    }
                    _child = _child.sibling;
                  }
                  if (!didFindChild) {
                    {
                      throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
                    }
                  }
                }
              }
              if (!(a.alternate === b)) {
                {
                  throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
            }
            if (!(a.tag === HostRoot)) {
              {
                throw Error("Unable to find node on an unmounted component.");
              }
            }
            if (a.stateNode.current === a) {
              return fiber;
            }
            return alternate;
          }
          function findCurrentHostFiber(parent) {
            var currentParent = findCurrentFiberUsingSlowPath(parent);
            if (!currentParent) {
              return null;
            }
            var node = currentParent;
            while (true) {
              if (node.tag === HostComponent || node.tag === HostText) {
                return node;
              } else if (node.child) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === currentParent) {
                return null;
              }
              while (!node.sibling) {
                if (!node.return || node.return === currentParent) {
                  return null;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
            return null;
          }
          function findCurrentHostFiberWithNoPortals(parent) {
            var currentParent = findCurrentFiberUsingSlowPath(parent);
            if (!currentParent) {
              return null;
            }
            var node = currentParent;
            while (true) {
              if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI) {
                return node;
              } else if (node.child && node.tag !== HostPortal) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === currentParent) {
                return null;
              }
              while (!node.sibling) {
                if (!node.return || node.return === currentParent) {
                  return null;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
            return null;
          }
          function doesFiberContain(parentFiber, childFiber) {
            var node = childFiber;
            var parentFiberAlternate = parentFiber.alternate;
            while (node !== null) {
              if (node === parentFiber || node === parentFiberAlternate) {
                return true;
              }
              node = node.return;
            }
            return false;
          }
          var attemptUserBlockingHydration;
          function setAttemptUserBlockingHydration(fn) {
            attemptUserBlockingHydration = fn;
          }
          var attemptContinuousHydration;
          function setAttemptContinuousHydration(fn) {
            attemptContinuousHydration = fn;
          }
          var attemptHydrationAtCurrentPriority;
          function setAttemptHydrationAtCurrentPriority(fn) {
            attemptHydrationAtCurrentPriority = fn;
          }
          var attemptHydrationAtPriority;
          function setAttemptHydrationAtPriority(fn) {
            attemptHydrationAtPriority = fn;
          }
          var hasScheduledReplayAttempt = false;
          var queuedDiscreteEvents = [];
          var queuedFocus = null;
          var queuedDrag = null;
          var queuedMouse = null;
          var queuedPointers = /* @__PURE__ */ new Map();
          var queuedPointerCaptures = /* @__PURE__ */ new Map();
          var queuedExplicitHydrationTargets = [];
          function hasQueuedDiscreteEvents() {
            return queuedDiscreteEvents.length > 0;
          }
          var discreteReplayableEvents = [
            "mousedown",
            "mouseup",
            "touchcancel",
            "touchend",
            "touchstart",
            "auxclick",
            "dblclick",
            "pointercancel",
            "pointerdown",
            "pointerup",
            "dragend",
            "dragstart",
            "drop",
            "compositionend",
            "compositionstart",
            "keydown",
            "keypress",
            "keyup",
            "input",
            "textInput",
            "copy",
            "cut",
            "paste",
            "click",
            "change",
            "contextmenu",
            "reset",
            "submit"
          ];
          function isReplayableDiscreteEvent(eventType) {
            return discreteReplayableEvents.indexOf(eventType) > -1;
          }
          function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            return {
              blockedOn,
              domEventName,
              eventSystemFlags: eventSystemFlags | IS_REPLAYED,
              nativeEvent,
              targetContainers: [targetContainer]
            };
          }
          function queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
            queuedDiscreteEvents.push(queuedEvent);
          }
          function clearIfContinuousEvent(domEventName, nativeEvent) {
            switch (domEventName) {
              case "focusin":
              case "focusout":
                queuedFocus = null;
                break;
              case "dragenter":
              case "dragleave":
                queuedDrag = null;
                break;
              case "mouseover":
              case "mouseout":
                queuedMouse = null;
                break;
              case "pointerover":
              case "pointerout": {
                var pointerId = nativeEvent.pointerId;
                queuedPointers.delete(pointerId);
                break;
              }
              case "gotpointercapture":
              case "lostpointercapture": {
                var _pointerId = nativeEvent.pointerId;
                queuedPointerCaptures.delete(_pointerId);
                break;
              }
            }
          }
          function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
              var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
              if (blockedOn !== null) {
                var _fiber2 = getInstanceFromNode(blockedOn);
                if (_fiber2 !== null) {
                  attemptContinuousHydration(_fiber2);
                }
              }
              return queuedEvent;
            }
            existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
            var targetContainers = existingQueuedEvent.targetContainers;
            if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) {
              targetContainers.push(targetContainer);
            }
            return existingQueuedEvent;
          }
          function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            switch (domEventName) {
              case "focusin": {
                var focusEvent = nativeEvent;
                queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent);
                return true;
              }
              case "dragenter": {
                var dragEvent = nativeEvent;
                queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent);
                return true;
              }
              case "mouseover": {
                var mouseEvent = nativeEvent;
                queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent);
                return true;
              }
              case "pointerover": {
                var pointerEvent = nativeEvent;
                var pointerId = pointerEvent.pointerId;
                queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent));
                return true;
              }
              case "gotpointercapture": {
                var _pointerEvent = nativeEvent;
                var _pointerId2 = _pointerEvent.pointerId;
                queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent));
                return true;
              }
            }
            return false;
          }
          function attemptExplicitHydrationTarget(queuedTarget) {
            var targetInst = getClosestInstanceFromNode(queuedTarget.target);
            if (targetInst !== null) {
              var nearestMounted = getNearestMountedFiber(targetInst);
              if (nearestMounted !== null) {
                var tag = nearestMounted.tag;
                if (tag === SuspenseComponent) {
                  var instance = getSuspenseInstanceFromFiber(nearestMounted);
                  if (instance !== null) {
                    queuedTarget.blockedOn = instance;
                    attemptHydrationAtPriority(queuedTarget.lanePriority, function() {
                      Scheduler.unstable_runWithPriority(queuedTarget.priority, function() {
                        attemptHydrationAtCurrentPriority(nearestMounted);
                      });
                    });
                    return;
                  }
                } else if (tag === HostRoot) {
                  var root2 = nearestMounted.stateNode;
                  if (root2.hydrate) {
                    queuedTarget.blockedOn = getContainerFromFiber(nearestMounted);
                    return;
                  }
                }
              }
            }
            queuedTarget.blockedOn = null;
          }
          function attemptReplayContinuousQueuedEvent(queuedEvent) {
            if (queuedEvent.blockedOn !== null) {
              return false;
            }
            var targetContainers = queuedEvent.targetContainers;
            while (targetContainers.length > 0) {
              var targetContainer = targetContainers[0];
              var nextBlockedOn = attemptToDispatchEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);
              if (nextBlockedOn !== null) {
                var _fiber3 = getInstanceFromNode(nextBlockedOn);
                if (_fiber3 !== null) {
                  attemptContinuousHydration(_fiber3);
                }
                queuedEvent.blockedOn = nextBlockedOn;
                return false;
              }
              targetContainers.shift();
            }
            return true;
          }
          function attemptReplayContinuousQueuedEventInMap(queuedEvent, key2, map) {
            if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
              map.delete(key2);
            }
          }
          function replayUnblockedEvents() {
            hasScheduledReplayAttempt = false;
            while (queuedDiscreteEvents.length > 0) {
              var nextDiscreteEvent = queuedDiscreteEvents[0];
              if (nextDiscreteEvent.blockedOn !== null) {
                var _fiber4 = getInstanceFromNode(nextDiscreteEvent.blockedOn);
                if (_fiber4 !== null) {
                  attemptUserBlockingHydration(_fiber4);
                }
                break;
              }
              var targetContainers = nextDiscreteEvent.targetContainers;
              while (targetContainers.length > 0) {
                var targetContainer = targetContainers[0];
                var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.domEventName, nextDiscreteEvent.eventSystemFlags, targetContainer, nextDiscreteEvent.nativeEvent);
                if (nextBlockedOn !== null) {
                  nextDiscreteEvent.blockedOn = nextBlockedOn;
                  break;
                }
                targetContainers.shift();
              }
              if (nextDiscreteEvent.blockedOn === null) {
                queuedDiscreteEvents.shift();
              }
            }
            if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
              queuedFocus = null;
            }
            if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
              queuedDrag = null;
            }
            if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
              queuedMouse = null;
            }
            queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
            queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
          }
          function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
            if (queuedEvent.blockedOn === unblocked) {
              queuedEvent.blockedOn = null;
              if (!hasScheduledReplayAttempt) {
                hasScheduledReplayAttempt = true;
                Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
              }
            }
          }
          function retryIfBlockedOn(unblocked) {
            if (queuedDiscreteEvents.length > 0) {
              scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked);
              for (var i = 1; i < queuedDiscreteEvents.length; i++) {
                var queuedEvent = queuedDiscreteEvents[i];
                if (queuedEvent.blockedOn === unblocked) {
                  queuedEvent.blockedOn = null;
                }
              }
            }
            if (queuedFocus !== null) {
              scheduleCallbackIfUnblocked(queuedFocus, unblocked);
            }
            if (queuedDrag !== null) {
              scheduleCallbackIfUnblocked(queuedDrag, unblocked);
            }
            if (queuedMouse !== null) {
              scheduleCallbackIfUnblocked(queuedMouse, unblocked);
            }
            var unblock = function(queuedEvent2) {
              return scheduleCallbackIfUnblocked(queuedEvent2, unblocked);
            };
            queuedPointers.forEach(unblock);
            queuedPointerCaptures.forEach(unblock);
            for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
              var queuedTarget = queuedExplicitHydrationTargets[_i];
              if (queuedTarget.blockedOn === unblocked) {
                queuedTarget.blockedOn = null;
              }
            }
            while (queuedExplicitHydrationTargets.length > 0) {
              var nextExplicitTarget = queuedExplicitHydrationTargets[0];
              if (nextExplicitTarget.blockedOn !== null) {
                break;
              } else {
                attemptExplicitHydrationTarget(nextExplicitTarget);
                if (nextExplicitTarget.blockedOn === null) {
                  queuedExplicitHydrationTargets.shift();
                }
              }
            }
          }
          var DiscreteEvent = 0;
          var UserBlockingEvent = 1;
          var ContinuousEvent = 2;
          function makePrefixMap(styleProp, eventName) {
            var prefixes2 = {};
            prefixes2[styleProp.toLowerCase()] = eventName.toLowerCase();
            prefixes2["Webkit" + styleProp] = "webkit" + eventName;
            prefixes2["Moz" + styleProp] = "moz" + eventName;
            return prefixes2;
          }
          var vendorPrefixes = {
            animationend: makePrefixMap("Animation", "AnimationEnd"),
            animationiteration: makePrefixMap("Animation", "AnimationIteration"),
            animationstart: makePrefixMap("Animation", "AnimationStart"),
            transitionend: makePrefixMap("Transition", "TransitionEnd")
          };
          var prefixedEventNames = {};
          var style2 = {};
          if (canUseDOM) {
            style2 = document.createElement("div").style;
            if (!("AnimationEvent" in window)) {
              delete vendorPrefixes.animationend.animation;
              delete vendorPrefixes.animationiteration.animation;
              delete vendorPrefixes.animationstart.animation;
            }
            if (!("TransitionEvent" in window)) {
              delete vendorPrefixes.transitionend.transition;
            }
          }
          function getVendorPrefixedEventName(eventName) {
            if (prefixedEventNames[eventName]) {
              return prefixedEventNames[eventName];
            } else if (!vendorPrefixes[eventName]) {
              return eventName;
            }
            var prefixMap = vendorPrefixes[eventName];
            for (var styleProp in prefixMap) {
              if (prefixMap.hasOwnProperty(styleProp) && styleProp in style2) {
                return prefixedEventNames[eventName] = prefixMap[styleProp];
              }
            }
            return eventName;
          }
          var ANIMATION_END = getVendorPrefixedEventName("animationend");
          var ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration");
          var ANIMATION_START = getVendorPrefixedEventName("animationstart");
          var TRANSITION_END = getVendorPrefixedEventName("transitionend");
          var topLevelEventsToReactNames = /* @__PURE__ */ new Map();
          var eventPriorities = /* @__PURE__ */ new Map();
          var discreteEventPairsForSimpleEventPlugin = [
            "cancel",
            "cancel",
            "click",
            "click",
            "close",
            "close",
            "contextmenu",
            "contextMenu",
            "copy",
            "copy",
            "cut",
            "cut",
            "auxclick",
            "auxClick",
            "dblclick",
            "doubleClick",
            "dragend",
            "dragEnd",
            "dragstart",
            "dragStart",
            "drop",
            "drop",
            "focusin",
            "focus",
            "focusout",
            "blur",
            "input",
            "input",
            "invalid",
            "invalid",
            "keydown",
            "keyDown",
            "keypress",
            "keyPress",
            "keyup",
            "keyUp",
            "mousedown",
            "mouseDown",
            "mouseup",
            "mouseUp",
            "paste",
            "paste",
            "pause",
            "pause",
            "play",
            "play",
            "pointercancel",
            "pointerCancel",
            "pointerdown",
            "pointerDown",
            "pointerup",
            "pointerUp",
            "ratechange",
            "rateChange",
            "reset",
            "reset",
            "seeked",
            "seeked",
            "submit",
            "submit",
            "touchcancel",
            "touchCancel",
            "touchend",
            "touchEnd",
            "touchstart",
            "touchStart",
            "volumechange",
            "volumeChange"
          ];
          var otherDiscreteEvents = ["change", "selectionchange", "textInput", "compositionstart", "compositionend", "compositionupdate"];
          var userBlockingPairsForSimpleEventPlugin = ["drag", "drag", "dragenter", "dragEnter", "dragexit", "dragExit", "dragleave", "dragLeave", "dragover", "dragOver", "mousemove", "mouseMove", "mouseout", "mouseOut", "mouseover", "mouseOver", "pointermove", "pointerMove", "pointerout", "pointerOut", "pointerover", "pointerOver", "scroll", "scroll", "toggle", "toggle", "touchmove", "touchMove", "wheel", "wheel"];
          var continuousPairsForSimpleEventPlugin = ["abort", "abort", ANIMATION_END, "animationEnd", ANIMATION_ITERATION, "animationIteration", ANIMATION_START, "animationStart", "canplay", "canPlay", "canplaythrough", "canPlayThrough", "durationchange", "durationChange", "emptied", "emptied", "encrypted", "encrypted", "ended", "ended", "error", "error", "gotpointercapture", "gotPointerCapture", "load", "load", "loadeddata", "loadedData", "loadedmetadata", "loadedMetadata", "loadstart", "loadStart", "lostpointercapture", "lostPointerCapture", "playing", "playing", "progress", "progress", "seeking", "seeking", "stalled", "stalled", "suspend", "suspend", "timeupdate", "timeUpdate", TRANSITION_END, "transitionEnd", "waiting", "waiting"];
          function registerSimplePluginEventsAndSetTheirPriorities(eventTypes, priority) {
            for (var i = 0; i < eventTypes.length; i += 2) {
              var topEvent = eventTypes[i];
              var event = eventTypes[i + 1];
              var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
              var reactName = "on" + capitalizedEvent;
              eventPriorities.set(topEvent, priority);
              topLevelEventsToReactNames.set(topEvent, reactName);
              registerTwoPhaseEvent(reactName, [topEvent]);
            }
          }
          function setEventPriorities(eventTypes, priority) {
            for (var i = 0; i < eventTypes.length; i++) {
              eventPriorities.set(eventTypes[i], priority);
            }
          }
          function getEventPriorityForPluginSystem(domEventName) {
            var priority = eventPriorities.get(domEventName);
            return priority === void 0 ? ContinuousEvent : priority;
          }
          function registerSimpleEvents() {
            registerSimplePluginEventsAndSetTheirPriorities(discreteEventPairsForSimpleEventPlugin, DiscreteEvent);
            registerSimplePluginEventsAndSetTheirPriorities(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent);
            registerSimplePluginEventsAndSetTheirPriorities(continuousPairsForSimpleEventPlugin, ContinuousEvent);
            setEventPriorities(otherDiscreteEvents, DiscreteEvent);
          }
          var Scheduler_now = Scheduler.unstable_now;
          {
            if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
              {
                throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");
              }
            }
          }
          var ImmediatePriority = 99;
          var UserBlockingPriority = 98;
          var NormalPriority = 97;
          var LowPriority = 96;
          var IdlePriority = 95;
          var NoPriority = 90;
          var initialTimeMs = Scheduler_now();
          var SyncLanePriority = 15;
          var SyncBatchedLanePriority = 14;
          var InputDiscreteHydrationLanePriority = 13;
          var InputDiscreteLanePriority = 12;
          var InputContinuousHydrationLanePriority = 11;
          var InputContinuousLanePriority = 10;
          var DefaultHydrationLanePriority = 9;
          var DefaultLanePriority = 8;
          var TransitionHydrationPriority = 7;
          var TransitionPriority = 6;
          var RetryLanePriority = 5;
          var SelectiveHydrationLanePriority = 4;
          var IdleHydrationLanePriority = 3;
          var IdleLanePriority = 2;
          var OffscreenLanePriority = 1;
          var NoLanePriority = 0;
          var TotalLanes = 31;
          var NoLanes = 0;
          var NoLane = 0;
          var SyncLane = 1;
          var SyncBatchedLane = 2;
          var InputDiscreteHydrationLane = 4;
          var InputDiscreteLanes = 24;
          var InputContinuousHydrationLane = 32;
          var InputContinuousLanes = 192;
          var DefaultHydrationLane = 256;
          var DefaultLanes = 3584;
          var TransitionHydrationLane = 4096;
          var TransitionLanes = 4186112;
          var RetryLanes = 62914560;
          var SomeRetryLane = 33554432;
          var SelectiveHydrationLane = 67108864;
          var NonIdleLanes = 134217727;
          var IdleHydrationLane = 134217728;
          var IdleLanes = 805306368;
          var OffscreenLane = 1073741824;
          var NoTimestamp = -1;
          function setCurrentUpdateLanePriority(newLanePriority) {
          }
          var return_highestLanePriority = DefaultLanePriority;
          function getHighestPriorityLanes(lanes) {
            if ((SyncLane & lanes) !== NoLanes) {
              return_highestLanePriority = SyncLanePriority;
              return SyncLane;
            }
            if ((SyncBatchedLane & lanes) !== NoLanes) {
              return_highestLanePriority = SyncBatchedLanePriority;
              return SyncBatchedLane;
            }
            if ((InputDiscreteHydrationLane & lanes) !== NoLanes) {
              return_highestLanePriority = InputDiscreteHydrationLanePriority;
              return InputDiscreteHydrationLane;
            }
            var inputDiscreteLanes = InputDiscreteLanes & lanes;
            if (inputDiscreteLanes !== NoLanes) {
              return_highestLanePriority = InputDiscreteLanePriority;
              return inputDiscreteLanes;
            }
            if ((lanes & InputContinuousHydrationLane) !== NoLanes) {
              return_highestLanePriority = InputContinuousHydrationLanePriority;
              return InputContinuousHydrationLane;
            }
            var inputContinuousLanes = InputContinuousLanes & lanes;
            if (inputContinuousLanes !== NoLanes) {
              return_highestLanePriority = InputContinuousLanePriority;
              return inputContinuousLanes;
            }
            if ((lanes & DefaultHydrationLane) !== NoLanes) {
              return_highestLanePriority = DefaultHydrationLanePriority;
              return DefaultHydrationLane;
            }
            var defaultLanes = DefaultLanes & lanes;
            if (defaultLanes !== NoLanes) {
              return_highestLanePriority = DefaultLanePriority;
              return defaultLanes;
            }
            if ((lanes & TransitionHydrationLane) !== NoLanes) {
              return_highestLanePriority = TransitionHydrationPriority;
              return TransitionHydrationLane;
            }
            var transitionLanes = TransitionLanes & lanes;
            if (transitionLanes !== NoLanes) {
              return_highestLanePriority = TransitionPriority;
              return transitionLanes;
            }
            var retryLanes = RetryLanes & lanes;
            if (retryLanes !== NoLanes) {
              return_highestLanePriority = RetryLanePriority;
              return retryLanes;
            }
            if (lanes & SelectiveHydrationLane) {
              return_highestLanePriority = SelectiveHydrationLanePriority;
              return SelectiveHydrationLane;
            }
            if ((lanes & IdleHydrationLane) !== NoLanes) {
              return_highestLanePriority = IdleHydrationLanePriority;
              return IdleHydrationLane;
            }
            var idleLanes = IdleLanes & lanes;
            if (idleLanes !== NoLanes) {
              return_highestLanePriority = IdleLanePriority;
              return idleLanes;
            }
            if ((OffscreenLane & lanes) !== NoLanes) {
              return_highestLanePriority = OffscreenLanePriority;
              return OffscreenLane;
            }
            {
              error("Should have found matching lanes. This is a bug in React.");
            }
            return_highestLanePriority = DefaultLanePriority;
            return lanes;
          }
          function schedulerPriorityToLanePriority(schedulerPriorityLevel) {
            switch (schedulerPriorityLevel) {
              case ImmediatePriority:
                return SyncLanePriority;
              case UserBlockingPriority:
                return InputContinuousLanePriority;
              case NormalPriority:
              case LowPriority:
                return DefaultLanePriority;
              case IdlePriority:
                return IdleLanePriority;
              default:
                return NoLanePriority;
            }
          }
          function lanePriorityToSchedulerPriority(lanePriority) {
            switch (lanePriority) {
              case SyncLanePriority:
              case SyncBatchedLanePriority:
                return ImmediatePriority;
              case InputDiscreteHydrationLanePriority:
              case InputDiscreteLanePriority:
              case InputContinuousHydrationLanePriority:
              case InputContinuousLanePriority:
                return UserBlockingPriority;
              case DefaultHydrationLanePriority:
              case DefaultLanePriority:
              case TransitionHydrationPriority:
              case TransitionPriority:
              case SelectiveHydrationLanePriority:
              case RetryLanePriority:
                return NormalPriority;
              case IdleHydrationLanePriority:
              case IdleLanePriority:
              case OffscreenLanePriority:
                return IdlePriority;
              case NoLanePriority:
                return NoPriority;
              default: {
                {
                  throw Error("Invalid update priority: " + lanePriority + ". This is a bug in React.");
                }
              }
            }
          }
          function getNextLanes(root2, wipLanes) {
            var pendingLanes = root2.pendingLanes;
            if (pendingLanes === NoLanes) {
              return_highestLanePriority = NoLanePriority;
              return NoLanes;
            }
            var nextLanes = NoLanes;
            var nextLanePriority = NoLanePriority;
            var expiredLanes = root2.expiredLanes;
            var suspendedLanes = root2.suspendedLanes;
            var pingedLanes = root2.pingedLanes;
            if (expiredLanes !== NoLanes) {
              nextLanes = expiredLanes;
              nextLanePriority = return_highestLanePriority = SyncLanePriority;
            } else {
              var nonIdlePendingLanes = pendingLanes & NonIdleLanes;
              if (nonIdlePendingLanes !== NoLanes) {
                var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;
                if (nonIdleUnblockedLanes !== NoLanes) {
                  nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);
                  nextLanePriority = return_highestLanePriority;
                } else {
                  var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;
                  if (nonIdlePingedLanes !== NoLanes) {
                    nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);
                    nextLanePriority = return_highestLanePriority;
                  }
                }
              } else {
                var unblockedLanes = pendingLanes & ~suspendedLanes;
                if (unblockedLanes !== NoLanes) {
                  nextLanes = getHighestPriorityLanes(unblockedLanes);
                  nextLanePriority = return_highestLanePriority;
                } else {
                  if (pingedLanes !== NoLanes) {
                    nextLanes = getHighestPriorityLanes(pingedLanes);
                    nextLanePriority = return_highestLanePriority;
                  }
                }
              }
            }
            if (nextLanes === NoLanes) {
              return NoLanes;
            }
            nextLanes = pendingLanes & getEqualOrHigherPriorityLanes(nextLanes);
            if (wipLanes !== NoLanes && wipLanes !== nextLanes && (wipLanes & suspendedLanes) === NoLanes) {
              getHighestPriorityLanes(wipLanes);
              var wipLanePriority = return_highestLanePriority;
              if (nextLanePriority <= wipLanePriority) {
                return wipLanes;
              } else {
                return_highestLanePriority = nextLanePriority;
              }
            }
            var entangledLanes = root2.entangledLanes;
            if (entangledLanes !== NoLanes) {
              var entanglements = root2.entanglements;
              var lanes = nextLanes & entangledLanes;
              while (lanes > 0) {
                var index2 = pickArbitraryLaneIndex(lanes);
                var lane = 1 << index2;
                nextLanes |= entanglements[index2];
                lanes &= ~lane;
              }
            }
            return nextLanes;
          }
          function getMostRecentEventTime(root2, lanes) {
            var eventTimes = root2.eventTimes;
            var mostRecentEventTime = NoTimestamp;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              var eventTime = eventTimes[index2];
              if (eventTime > mostRecentEventTime) {
                mostRecentEventTime = eventTime;
              }
              lanes &= ~lane;
            }
            return mostRecentEventTime;
          }
          function computeExpirationTime(lane, currentTime) {
            getHighestPriorityLanes(lane);
            var priority = return_highestLanePriority;
            if (priority >= InputContinuousLanePriority) {
              return currentTime + 250;
            } else if (priority >= TransitionPriority) {
              return currentTime + 5e3;
            } else {
              return NoTimestamp;
            }
          }
          function markStarvedLanesAsExpired(root2, currentTime) {
            var pendingLanes = root2.pendingLanes;
            var suspendedLanes = root2.suspendedLanes;
            var pingedLanes = root2.pingedLanes;
            var expirationTimes = root2.expirationTimes;
            var lanes = pendingLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              var expirationTime = expirationTimes[index2];
              if (expirationTime === NoTimestamp) {
                if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) {
                  expirationTimes[index2] = computeExpirationTime(lane, currentTime);
                }
              } else if (expirationTime <= currentTime) {
                root2.expiredLanes |= lane;
              }
              lanes &= ~lane;
            }
          }
          function getLanesToRetrySynchronouslyOnError(root2) {
            var everythingButOffscreen = root2.pendingLanes & ~OffscreenLane;
            if (everythingButOffscreen !== NoLanes) {
              return everythingButOffscreen;
            }
            if (everythingButOffscreen & OffscreenLane) {
              return OffscreenLane;
            }
            return NoLanes;
          }
          function returnNextLanesPriority() {
            return return_highestLanePriority;
          }
          function includesNonIdleWork(lanes) {
            return (lanes & NonIdleLanes) !== NoLanes;
          }
          function includesOnlyRetries(lanes) {
            return (lanes & RetryLanes) === lanes;
          }
          function includesOnlyTransitions(lanes) {
            return (lanes & TransitionLanes) === lanes;
          }
          function findUpdateLane(lanePriority, wipLanes) {
            switch (lanePriority) {
              case NoLanePriority:
                break;
              case SyncLanePriority:
                return SyncLane;
              case SyncBatchedLanePriority:
                return SyncBatchedLane;
              case InputDiscreteLanePriority: {
                var _lane = pickArbitraryLane(InputDiscreteLanes & ~wipLanes);
                if (_lane === NoLane) {
                  return findUpdateLane(InputContinuousLanePriority, wipLanes);
                }
                return _lane;
              }
              case InputContinuousLanePriority: {
                var _lane2 = pickArbitraryLane(InputContinuousLanes & ~wipLanes);
                if (_lane2 === NoLane) {
                  return findUpdateLane(DefaultLanePriority, wipLanes);
                }
                return _lane2;
              }
              case DefaultLanePriority: {
                var _lane3 = pickArbitraryLane(DefaultLanes & ~wipLanes);
                if (_lane3 === NoLane) {
                  _lane3 = pickArbitraryLane(TransitionLanes & ~wipLanes);
                  if (_lane3 === NoLane) {
                    _lane3 = pickArbitraryLane(DefaultLanes);
                  }
                }
                return _lane3;
              }
              case TransitionPriority:
              case RetryLanePriority:
                break;
              case IdleLanePriority:
                var lane = pickArbitraryLane(IdleLanes & ~wipLanes);
                if (lane === NoLane) {
                  lane = pickArbitraryLane(IdleLanes);
                }
                return lane;
            }
            {
              {
                throw Error("Invalid update priority: " + lanePriority + ". This is a bug in React.");
              }
            }
          }
          function findTransitionLane(wipLanes, pendingLanes) {
            var lane = pickArbitraryLane(TransitionLanes & ~pendingLanes);
            if (lane === NoLane) {
              lane = pickArbitraryLane(TransitionLanes & ~wipLanes);
              if (lane === NoLane) {
                lane = pickArbitraryLane(TransitionLanes);
              }
            }
            return lane;
          }
          function findRetryLane(wipLanes) {
            var lane = pickArbitraryLane(RetryLanes & ~wipLanes);
            if (lane === NoLane) {
              lane = pickArbitraryLane(RetryLanes);
            }
            return lane;
          }
          function getHighestPriorityLane(lanes) {
            return lanes & -lanes;
          }
          function getLowestPriorityLane(lanes) {
            var index2 = 31 - clz32(lanes);
            return index2 < 0 ? NoLanes : 1 << index2;
          }
          function getEqualOrHigherPriorityLanes(lanes) {
            return (getLowestPriorityLane(lanes) << 1) - 1;
          }
          function pickArbitraryLane(lanes) {
            return getHighestPriorityLane(lanes);
          }
          function pickArbitraryLaneIndex(lanes) {
            return 31 - clz32(lanes);
          }
          function laneToIndex(lane) {
            return pickArbitraryLaneIndex(lane);
          }
          function includesSomeLane(a, b) {
            return (a & b) !== NoLanes;
          }
          function isSubsetOfLanes(set2, subset) {
            return (set2 & subset) === subset;
          }
          function mergeLanes(a, b) {
            return a | b;
          }
          function removeLanes(set2, subset) {
            return set2 & ~subset;
          }
          function laneToLanes(lane) {
            return lane;
          }
          function higherPriorityLane(a, b) {
            return a !== NoLane && a < b ? a : b;
          }
          function createLaneMap(initial) {
            var laneMap = [];
            for (var i = 0; i < TotalLanes; i++) {
              laneMap.push(initial);
            }
            return laneMap;
          }
          function markRootUpdated(root2, updateLane, eventTime) {
            root2.pendingLanes |= updateLane;
            var higherPriorityLanes = updateLane - 1;
            root2.suspendedLanes &= higherPriorityLanes;
            root2.pingedLanes &= higherPriorityLanes;
            var eventTimes = root2.eventTimes;
            var index2 = laneToIndex(updateLane);
            eventTimes[index2] = eventTime;
          }
          function markRootSuspended(root2, suspendedLanes) {
            root2.suspendedLanes |= suspendedLanes;
            root2.pingedLanes &= ~suspendedLanes;
            var expirationTimes = root2.expirationTimes;
            var lanes = suspendedLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              expirationTimes[index2] = NoTimestamp;
              lanes &= ~lane;
            }
          }
          function markRootPinged(root2, pingedLanes, eventTime) {
            root2.pingedLanes |= root2.suspendedLanes & pingedLanes;
          }
          function markDiscreteUpdatesExpired(root2) {
            root2.expiredLanes |= InputDiscreteLanes & root2.pendingLanes;
          }
          function hasDiscreteLanes(lanes) {
            return (lanes & InputDiscreteLanes) !== NoLanes;
          }
          function markRootMutableRead(root2, updateLane) {
            root2.mutableReadLanes |= updateLane & root2.pendingLanes;
          }
          function markRootFinished(root2, remainingLanes) {
            var noLongerPendingLanes = root2.pendingLanes & ~remainingLanes;
            root2.pendingLanes = remainingLanes;
            root2.suspendedLanes = 0;
            root2.pingedLanes = 0;
            root2.expiredLanes &= remainingLanes;
            root2.mutableReadLanes &= remainingLanes;
            root2.entangledLanes &= remainingLanes;
            var entanglements = root2.entanglements;
            var eventTimes = root2.eventTimes;
            var expirationTimes = root2.expirationTimes;
            var lanes = noLongerPendingLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              entanglements[index2] = NoLanes;
              eventTimes[index2] = NoTimestamp;
              expirationTimes[index2] = NoTimestamp;
              lanes &= ~lane;
            }
          }
          function markRootEntangled(root2, entangledLanes) {
            root2.entangledLanes |= entangledLanes;
            var entanglements = root2.entanglements;
            var lanes = entangledLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              entanglements[index2] |= entangledLanes;
              lanes &= ~lane;
            }
          }
          var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback;
          var log = Math.log;
          var LN2 = Math.LN2;
          function clz32Fallback(lanes) {
            if (lanes === 0) {
              return 32;
            }
            return 31 - (log(lanes) / LN2 | 0) | 0;
          }
          var UserBlockingPriority$1 = Scheduler.unstable_UserBlockingPriority, runWithPriority = Scheduler.unstable_runWithPriority;
          var _enabled = true;
          function setEnabled(enabled) {
            _enabled = !!enabled;
          }
          function isEnabled() {
            return _enabled;
          }
          function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {
            var eventPriority = getEventPriorityForPluginSystem(domEventName);
            var listenerWrapper;
            switch (eventPriority) {
              case DiscreteEvent:
                listenerWrapper = dispatchDiscreteEvent;
                break;
              case UserBlockingEvent:
                listenerWrapper = dispatchUserBlockingUpdate;
                break;
              case ContinuousEvent:
              default:
                listenerWrapper = dispatchEvent;
                break;
            }
            return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);
          }
          function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
            {
              flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);
            }
            discreteUpdates(dispatchEvent, domEventName, eventSystemFlags, container, nativeEvent);
          }
          function dispatchUserBlockingUpdate(domEventName, eventSystemFlags, container, nativeEvent) {
            {
              runWithPriority(UserBlockingPriority$1, dispatchEvent.bind(null, domEventName, eventSystemFlags, container, nativeEvent));
            }
          }
          function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            if (!_enabled) {
              return;
            }
            var allowReplay = true;
            {
              allowReplay = (eventSystemFlags & IS_CAPTURE_PHASE) === 0;
            }
            if (allowReplay && hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(domEventName)) {
              queueDiscreteEvent(
                null,
                domEventName,
                eventSystemFlags,
                targetContainer,
                nativeEvent
              );
              return;
            }
            var blockedOn = attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
            if (blockedOn === null) {
              if (allowReplay) {
                clearIfContinuousEvent(domEventName, nativeEvent);
              }
              return;
            }
            if (allowReplay) {
              if (isReplayableDiscreteEvent(domEventName)) {
                queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
                return;
              }
              if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {
                return;
              }
              clearIfContinuousEvent(domEventName, nativeEvent);
            }
            dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);
          }
          function attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            var nativeEventTarget = getEventTarget(nativeEvent);
            var targetInst = getClosestInstanceFromNode(nativeEventTarget);
            if (targetInst !== null) {
              var nearestMounted = getNearestMountedFiber(targetInst);
              if (nearestMounted === null) {
                targetInst = null;
              } else {
                var tag = nearestMounted.tag;
                if (tag === SuspenseComponent) {
                  var instance = getSuspenseInstanceFromFiber(nearestMounted);
                  if (instance !== null) {
                    return instance;
                  }
                  targetInst = null;
                } else if (tag === HostRoot) {
                  var root2 = nearestMounted.stateNode;
                  if (root2.hydrate) {
                    return getContainerFromFiber(nearestMounted);
                  }
                  targetInst = null;
                } else if (nearestMounted !== targetInst) {
                  targetInst = null;
                }
              }
            }
            dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer);
            return null;
          }
          function addEventBubbleListener(target, eventType, listener) {
            target.addEventListener(eventType, listener, false);
            return listener;
          }
          function addEventCaptureListener(target, eventType, listener) {
            target.addEventListener(eventType, listener, true);
            return listener;
          }
          function addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) {
            target.addEventListener(eventType, listener, {
              capture: true,
              passive
            });
            return listener;
          }
          function addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) {
            target.addEventListener(eventType, listener, {
              passive
            });
            return listener;
          }
          var root = null;
          var startText = null;
          var fallbackText = null;
          function initialize(nativeEventTarget) {
            root = nativeEventTarget;
            startText = getText();
            return true;
          }
          function reset() {
            root = null;
            startText = null;
            fallbackText = null;
          }
          function getData() {
            if (fallbackText) {
              return fallbackText;
            }
            var start;
            var startValue = startText;
            var startLength = startValue.length;
            var end;
            var endValue = getText();
            var endLength = endValue.length;
            for (start = 0; start < startLength; start++) {
              if (startValue[start] !== endValue[start]) {
                break;
              }
            }
            var minEnd = startLength - start;
            for (end = 1; end <= minEnd; end++) {
              if (startValue[startLength - end] !== endValue[endLength - end]) {
                break;
              }
            }
            var sliceTail = end > 1 ? 1 - end : void 0;
            fallbackText = endValue.slice(start, sliceTail);
            return fallbackText;
          }
          function getText() {
            if ("value" in root) {
              return root.value;
            }
            return root.textContent;
          }
          function getEventCharCode(nativeEvent) {
            var charCode;
            var keyCode = nativeEvent.keyCode;
            if ("charCode" in nativeEvent) {
              charCode = nativeEvent.charCode;
              if (charCode === 0 && keyCode === 13) {
                charCode = 13;
              }
            } else {
              charCode = keyCode;
            }
            if (charCode === 10) {
              charCode = 13;
            }
            if (charCode >= 32 || charCode === 13) {
              return charCode;
            }
            return 0;
          }
          function functionThatReturnsTrue() {
            return true;
          }
          function functionThatReturnsFalse() {
            return false;
          }
          function createSyntheticEvent(Interface) {
            function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
              this._reactName = reactName;
              this._targetInst = targetInst;
              this.type = reactEventType;
              this.nativeEvent = nativeEvent;
              this.target = nativeEventTarget;
              this.currentTarget = null;
              for (var _propName in Interface) {
                if (!Interface.hasOwnProperty(_propName)) {
                  continue;
                }
                var normalize = Interface[_propName];
                if (normalize) {
                  this[_propName] = normalize(nativeEvent);
                } else {
                  this[_propName] = nativeEvent[_propName];
                }
              }
              var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
              if (defaultPrevented) {
                this.isDefaultPrevented = functionThatReturnsTrue;
              } else {
                this.isDefaultPrevented = functionThatReturnsFalse;
              }
              this.isPropagationStopped = functionThatReturnsFalse;
              return this;
            }
            _assign(SyntheticBaseEvent.prototype, {
              preventDefault: function() {
                this.defaultPrevented = true;
                var event = this.nativeEvent;
                if (!event) {
                  return;
                }
                if (event.preventDefault) {
                  event.preventDefault();
                } else if (typeof event.returnValue !== "unknown") {
                  event.returnValue = false;
                }
                this.isDefaultPrevented = functionThatReturnsTrue;
              },
              stopPropagation: function() {
                var event = this.nativeEvent;
                if (!event) {
                  return;
                }
                if (event.stopPropagation) {
                  event.stopPropagation();
                } else if (typeof event.cancelBubble !== "unknown") {
                  event.cancelBubble = true;
                }
                this.isPropagationStopped = functionThatReturnsTrue;
              },
              persist: function() {
              },
              isPersistent: functionThatReturnsTrue
            });
            return SyntheticBaseEvent;
          }
          var EventInterface = {
            eventPhase: 0,
            bubbles: 0,
            cancelable: 0,
            timeStamp: function(event) {
              return event.timeStamp || Date.now();
            },
            defaultPrevented: 0,
            isTrusted: 0
          };
          var SyntheticEvent = createSyntheticEvent(EventInterface);
          var UIEventInterface = _assign({}, EventInterface, {
            view: 0,
            detail: 0
          });
          var SyntheticUIEvent = createSyntheticEvent(UIEventInterface);
          var lastMovementX;
          var lastMovementY;
          var lastMouseEvent;
          function updateMouseMovementPolyfillState(event) {
            if (event !== lastMouseEvent) {
              if (lastMouseEvent && event.type === "mousemove") {
                lastMovementX = event.screenX - lastMouseEvent.screenX;
                lastMovementY = event.screenY - lastMouseEvent.screenY;
              } else {
                lastMovementX = 0;
                lastMovementY = 0;
              }
              lastMouseEvent = event;
            }
          }
          var MouseEventInterface = _assign({}, UIEventInterface, {
            screenX: 0,
            screenY: 0,
            clientX: 0,
            clientY: 0,
            pageX: 0,
            pageY: 0,
            ctrlKey: 0,
            shiftKey: 0,
            altKey: 0,
            metaKey: 0,
            getModifierState: getEventModifierState,
            button: 0,
            buttons: 0,
            relatedTarget: function(event) {
              if (event.relatedTarget === void 0)
                return event.fromElement === event.srcElement ? event.toElement : event.fromElement;
              return event.relatedTarget;
            },
            movementX: function(event) {
              if ("movementX" in event) {
                return event.movementX;
              }
              updateMouseMovementPolyfillState(event);
              return lastMovementX;
            },
            movementY: function(event) {
              if ("movementY" in event) {
                return event.movementY;
              }
              return lastMovementY;
            }
          });
          var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);
          var DragEventInterface = _assign({}, MouseEventInterface, {
            dataTransfer: 0
          });
          var SyntheticDragEvent = createSyntheticEvent(DragEventInterface);
          var FocusEventInterface = _assign({}, UIEventInterface, {
            relatedTarget: 0
          });
          var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);
          var AnimationEventInterface = _assign({}, EventInterface, {
            animationName: 0,
            elapsedTime: 0,
            pseudoElement: 0
          });
          var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);
          var ClipboardEventInterface = _assign({}, EventInterface, {
            clipboardData: function(event) {
              return "clipboardData" in event ? event.clipboardData : window.clipboardData;
            }
          });
          var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);
          var CompositionEventInterface = _assign({}, EventInterface, {
            data: 0
          });
          var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);
          var SyntheticInputEvent = SyntheticCompositionEvent;
          var normalizeKey = {
            Esc: "Escape",
            Spacebar: " ",
            Left: "ArrowLeft",
            Up: "ArrowUp",
            Right: "ArrowRight",
            Down: "ArrowDown",
            Del: "Delete",
            Win: "OS",
            Menu: "ContextMenu",
            Apps: "ContextMenu",
            Scroll: "ScrollLock",
            MozPrintableKey: "Unidentified"
          };
          var translateToKey = {
            "8": "Backspace",
            "9": "Tab",
            "12": "Clear",
            "13": "Enter",
            "16": "Shift",
            "17": "Control",
            "18": "Alt",
            "19": "Pause",
            "20": "CapsLock",
            "27": "Escape",
            "32": " ",
            "33": "PageUp",
            "34": "PageDown",
            "35": "End",
            "36": "Home",
            "37": "ArrowLeft",
            "38": "ArrowUp",
            "39": "ArrowRight",
            "40": "ArrowDown",
            "45": "Insert",
            "46": "Delete",
            "112": "F1",
            "113": "F2",
            "114": "F3",
            "115": "F4",
            "116": "F5",
            "117": "F6",
            "118": "F7",
            "119": "F8",
            "120": "F9",
            "121": "F10",
            "122": "F11",
            "123": "F12",
            "144": "NumLock",
            "145": "ScrollLock",
            "224": "Meta"
          };
          function getEventKey(nativeEvent) {
            if (nativeEvent.key) {
              var key2 = normalizeKey[nativeEvent.key] || nativeEvent.key;
              if (key2 !== "Unidentified") {
                return key2;
              }
            }
            if (nativeEvent.type === "keypress") {
              var charCode = getEventCharCode(nativeEvent);
              return charCode === 13 ? "Enter" : String.fromCharCode(charCode);
            }
            if (nativeEvent.type === "keydown" || nativeEvent.type === "keyup") {
              return translateToKey[nativeEvent.keyCode] || "Unidentified";
            }
            return "";
          }
          var modifierKeyToProp = {
            Alt: "altKey",
            Control: "ctrlKey",
            Meta: "metaKey",
            Shift: "shiftKey"
          };
          function modifierStateGetter(keyArg) {
            var syntheticEvent = this;
            var nativeEvent = syntheticEvent.nativeEvent;
            if (nativeEvent.getModifierState) {
              return nativeEvent.getModifierState(keyArg);
            }
            var keyProp = modifierKeyToProp[keyArg];
            return keyProp ? !!nativeEvent[keyProp] : false;
          }
          function getEventModifierState(nativeEvent) {
            return modifierStateGetter;
          }
          var KeyboardEventInterface = _assign({}, UIEventInterface, {
            key: getEventKey,
            code: 0,
            location: 0,
            ctrlKey: 0,
            shiftKey: 0,
            altKey: 0,
            metaKey: 0,
            repeat: 0,
            locale: 0,
            getModifierState: getEventModifierState,
            charCode: function(event) {
              if (event.type === "keypress") {
                return getEventCharCode(event);
              }
              return 0;
            },
            keyCode: function(event) {
              if (event.type === "keydown" || event.type === "keyup") {
                return event.keyCode;
              }
              return 0;
            },
            which: function(event) {
              if (event.type === "keypress") {
                return getEventCharCode(event);
              }
              if (event.type === "keydown" || event.type === "keyup") {
                return event.keyCode;
              }
              return 0;
            }
          });
          var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);
          var PointerEventInterface = _assign({}, MouseEventInterface, {
            pointerId: 0,
            width: 0,
            height: 0,
            pressure: 0,
            tangentialPressure: 0,
            tiltX: 0,
            tiltY: 0,
            twist: 0,
            pointerType: 0,
            isPrimary: 0
          });
          var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);
          var TouchEventInterface = _assign({}, UIEventInterface, {
            touches: 0,
            targetTouches: 0,
            changedTouches: 0,
            altKey: 0,
            metaKey: 0,
            ctrlKey: 0,
            shiftKey: 0,
            getModifierState: getEventModifierState
          });
          var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);
          var TransitionEventInterface = _assign({}, EventInterface, {
            propertyName: 0,
            elapsedTime: 0,
            pseudoElement: 0
          });
          var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);
          var WheelEventInterface = _assign({}, MouseEventInterface, {
            deltaX: function(event) {
              return "deltaX" in event ? event.deltaX : "wheelDeltaX" in event ? -event.wheelDeltaX : 0;
            },
            deltaY: function(event) {
              return "deltaY" in event ? event.deltaY : "wheelDeltaY" in event ? -event.wheelDeltaY : "wheelDelta" in event ? -event.wheelDelta : 0;
            },
            deltaZ: 0,
            deltaMode: 0
          });
          var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);
          var END_KEYCODES = [9, 13, 27, 32];
          var START_KEYCODE = 229;
          var canUseCompositionEvent = canUseDOM && "CompositionEvent" in window;
          var documentMode = null;
          if (canUseDOM && "documentMode" in document) {
            documentMode = document.documentMode;
          }
          var canUseTextInputEvent = canUseDOM && "TextEvent" in window && !documentMode;
          var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
          var SPACEBAR_CODE = 32;
          var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
          function registerEvents() {
            registerTwoPhaseEvent("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]);
            registerTwoPhaseEvent("onCompositionEnd", ["compositionend", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
            registerTwoPhaseEvent("onCompositionStart", ["compositionstart", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
            registerTwoPhaseEvent("onCompositionUpdate", ["compositionupdate", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
          }
          var hasSpaceKeypress = false;
          function isKeypressCommand(nativeEvent) {
            return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && !(nativeEvent.ctrlKey && nativeEvent.altKey);
          }
          function getCompositionEventType(domEventName) {
            switch (domEventName) {
              case "compositionstart":
                return "onCompositionStart";
              case "compositionend":
                return "onCompositionEnd";
              case "compositionupdate":
                return "onCompositionUpdate";
            }
          }
          function isFallbackCompositionStart(domEventName, nativeEvent) {
            return domEventName === "keydown" && nativeEvent.keyCode === START_KEYCODE;
          }
          function isFallbackCompositionEnd(domEventName, nativeEvent) {
            switch (domEventName) {
              case "keyup":
                return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
              case "keydown":
                return nativeEvent.keyCode !== START_KEYCODE;
              case "keypress":
              case "mousedown":
              case "focusout":
                return true;
              default:
                return false;
            }
          }
          function getDataFromCustomEvent(nativeEvent) {
            var detail = nativeEvent.detail;
            if (typeof detail === "object" && "data" in detail) {
              return detail.data;
            }
            return null;
          }
          function isUsingKoreanIME(nativeEvent) {
            return nativeEvent.locale === "ko";
          }
          var isComposing = false;
          function extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
            var eventType;
            var fallbackData;
            if (canUseCompositionEvent) {
              eventType = getCompositionEventType(domEventName);
            } else if (!isComposing) {
              if (isFallbackCompositionStart(domEventName, nativeEvent)) {
                eventType = "onCompositionStart";
              }
            } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) {
              eventType = "onCompositionEnd";
            }
            if (!eventType) {
              return null;
            }
            if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
              if (!isComposing && eventType === "onCompositionStart") {
                isComposing = initialize(nativeEventTarget);
              } else if (eventType === "onCompositionEnd") {
                if (isComposing) {
                  fallbackData = getData();
                }
              }
            }
            var listeners = accumulateTwoPhaseListeners(targetInst, eventType);
            if (listeners.length > 0) {
              var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);
              dispatchQueue.push({
                event,
                listeners
              });
              if (fallbackData) {
                event.data = fallbackData;
              } else {
                var customData = getDataFromCustomEvent(nativeEvent);
                if (customData !== null) {
                  event.data = customData;
                }
              }
            }
          }
          function getNativeBeforeInputChars(domEventName, nativeEvent) {
            switch (domEventName) {
              case "compositionend":
                return getDataFromCustomEvent(nativeEvent);
              case "keypress":
                var which = nativeEvent.which;
                if (which !== SPACEBAR_CODE) {
                  return null;
                }
                hasSpaceKeypress = true;
                return SPACEBAR_CHAR;
              case "textInput":
                var chars = nativeEvent.data;
                if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
                  return null;
                }
                return chars;
              default:
                return null;
            }
          }
          function getFallbackBeforeInputChars(domEventName, nativeEvent) {
            if (isComposing) {
              if (domEventName === "compositionend" || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {
                var chars = getData();
                reset();
                isComposing = false;
                return chars;
              }
              return null;
            }
            switch (domEventName) {
              case "paste":
                return null;
              case "keypress":
                if (!isKeypressCommand(nativeEvent)) {
                  if (nativeEvent.char && nativeEvent.char.length > 1) {
                    return nativeEvent.char;
                  } else if (nativeEvent.which) {
                    return String.fromCharCode(nativeEvent.which);
                  }
                }
                return null;
              case "compositionend":
                return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
              default:
                return null;
            }
          }
          function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
            var chars;
            if (canUseTextInputEvent) {
              chars = getNativeBeforeInputChars(domEventName, nativeEvent);
            } else {
              chars = getFallbackBeforeInputChars(domEventName, nativeEvent);
            }
            if (!chars) {
              return null;
            }
            var listeners = accumulateTwoPhaseListeners(targetInst, "onBeforeInput");
            if (listeners.length > 0) {
              var event = new SyntheticInputEvent("onBeforeInput", "beforeinput", null, nativeEvent, nativeEventTarget);
              dispatchQueue.push({
                event,
                listeners
              });
              event.data = chars;
            }
          }
          function extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
            extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
          }
          var supportedInputTypes = {
            color: true,
            date: true,
            datetime: true,
            "datetime-local": true,
            email: true,
            month: true,
            number: true,
            password: true,
            range: true,
            search: true,
            tel: true,
            text: true,
            time: true,
            url: true,
            week: true
          };
          function isTextInputElement(elem) {
            var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
            if (nodeName === "input") {
              return !!supportedInputTypes[elem.type];
            }
            if (nodeName === "textarea") {
              return true;
            }
            return false;
          }
          function isEventSupported(eventNameSuffix) {
            if (!canUseDOM) {
              return false;
            }
            var eventName = "on" + eventNameSuffix;
            var isSupported = eventName in document;
            if (!isSupported) {
              var element = document.createElement("div");
              element.setAttribute(eventName, "return;");
              isSupported = typeof element[eventName] === "function";
            }
            return isSupported;
          }
          function registerEvents$1() {
            registerTwoPhaseEvent("onChange", ["change", "click", "focusin", "focusout", "input", "keydown", "keyup", "selectionchange"]);
          }
          function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
            enqueueStateRestore(target);
            var listeners = accumulateTwoPhaseListeners(inst, "onChange");
            if (listeners.length > 0) {
              var event = new SyntheticEvent("onChange", "change", null, nativeEvent, target);
              dispatchQueue.push({
                event,
                listeners
              });
            }
          }
          var activeElement = null;
          var activeElementInst = null;
          function shouldUseChangeEvent(elem) {
            var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
            return nodeName === "select" || nodeName === "input" && elem.type === "file";
          }
          function manualDispatchChangeEvent(nativeEvent) {
            var dispatchQueue = [];
            createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
            batchedUpdates(runEventInBatch, dispatchQueue);
          }
          function runEventInBatch(dispatchQueue) {
            processDispatchQueue(dispatchQueue, 0);
          }
          function getInstIfValueChanged(targetInst) {
            var targetNode = getNodeFromInstance(targetInst);
            if (updateValueIfChanged(targetNode)) {
              return targetInst;
            }
          }
          function getTargetInstForChangeEvent(domEventName, targetInst) {
            if (domEventName === "change") {
              return targetInst;
            }
          }
          var isInputEventSupported = false;
          if (canUseDOM) {
            isInputEventSupported = isEventSupported("input") && (!document.documentMode || document.documentMode > 9);
          }
          function startWatchingForValueChange(target, targetInst) {
            activeElement = target;
            activeElementInst = targetInst;
            activeElement.attachEvent("onpropertychange", handlePropertyChange);
          }
          function stopWatchingForValueChange() {
            if (!activeElement) {
              return;
            }
            activeElement.detachEvent("onpropertychange", handlePropertyChange);
            activeElement = null;
            activeElementInst = null;
          }
          function handlePropertyChange(nativeEvent) {
            if (nativeEvent.propertyName !== "value") {
              return;
            }
            if (getInstIfValueChanged(activeElementInst)) {
              manualDispatchChangeEvent(nativeEvent);
            }
          }
          function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
            if (domEventName === "focusin") {
              stopWatchingForValueChange();
              startWatchingForValueChange(target, targetInst);
            } else if (domEventName === "focusout") {
              stopWatchingForValueChange();
            }
          }
          function getTargetInstForInputEventPolyfill(domEventName, targetInst) {
            if (domEventName === "selectionchange" || domEventName === "keyup" || domEventName === "keydown") {
              return getInstIfValueChanged(activeElementInst);
            }
          }
          function shouldUseClickEvent(elem) {
            var nodeName = elem.nodeName;
            return nodeName && nodeName.toLowerCase() === "input" && (elem.type === "checkbox" || elem.type === "radio");
          }
          function getTargetInstForClickEvent(domEventName, targetInst) {
            if (domEventName === "click") {
              return getInstIfValueChanged(targetInst);
            }
          }
          function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
            if (domEventName === "input" || domEventName === "change") {
              return getInstIfValueChanged(targetInst);
            }
          }
          function handleControlledInputBlur(node) {
            var state = node._wrapperState;
            if (!state || !state.controlled || node.type !== "number") {
              return;
            }
            {
              setDefaultValue(node, "number", node.value);
            }
          }
          function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
            var getTargetInstFunc, handleEventFunc;
            if (shouldUseChangeEvent(targetNode)) {
              getTargetInstFunc = getTargetInstForChangeEvent;
            } else if (isTextInputElement(targetNode)) {
              if (isInputEventSupported) {
                getTargetInstFunc = getTargetInstForInputOrChangeEvent;
              } else {
                getTargetInstFunc = getTargetInstForInputEventPolyfill;
                handleEventFunc = handleEventsForInputEventPolyfill;
              }
            } else if (shouldUseClickEvent(targetNode)) {
              getTargetInstFunc = getTargetInstForClickEvent;
            }
            if (getTargetInstFunc) {
              var inst = getTargetInstFunc(domEventName, targetInst);
              if (inst) {
                createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget);
                return;
              }
            }
            if (handleEventFunc) {
              handleEventFunc(domEventName, targetNode, targetInst);
            }
            if (domEventName === "focusout") {
              handleControlledInputBlur(targetNode);
            }
          }
          function registerEvents$2() {
            registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
            registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
            registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
            registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
          }
          function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var isOverEvent = domEventName === "mouseover" || domEventName === "pointerover";
            var isOutEvent = domEventName === "mouseout" || domEventName === "pointerout";
            if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0) {
              var related = nativeEvent.relatedTarget || nativeEvent.fromElement;
              if (related) {
                if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) {
                  return;
                }
              }
            }
            if (!isOutEvent && !isOverEvent) {
              return;
            }
            var win;
            if (nativeEventTarget.window === nativeEventTarget) {
              win = nativeEventTarget;
            } else {
              var doc = nativeEventTarget.ownerDocument;
              if (doc) {
                win = doc.defaultView || doc.parentWindow;
              } else {
                win = window;
              }
            }
            var from;
            var to;
            if (isOutEvent) {
              var _related = nativeEvent.relatedTarget || nativeEvent.toElement;
              from = targetInst;
              to = _related ? getClosestInstanceFromNode(_related) : null;
              if (to !== null) {
                var nearestMounted = getNearestMountedFiber(to);
                if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
                  to = null;
                }
              }
            } else {
              from = null;
              to = targetInst;
            }
            if (from === to) {
              return;
            }
            var SyntheticEventCtor = SyntheticMouseEvent;
            var leaveEventType = "onMouseLeave";
            var enterEventType = "onMouseEnter";
            var eventTypePrefix = "mouse";
            if (domEventName === "pointerout" || domEventName === "pointerover") {
              SyntheticEventCtor = SyntheticPointerEvent;
              leaveEventType = "onPointerLeave";
              enterEventType = "onPointerEnter";
              eventTypePrefix = "pointer";
            }
            var fromNode = from == null ? win : getNodeFromInstance(from);
            var toNode = to == null ? win : getNodeFromInstance(to);
            var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + "leave", from, nativeEvent, nativeEventTarget);
            leave.target = fromNode;
            leave.relatedTarget = toNode;
            var enter = null;
            var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);
            if (nativeTargetInst === targetInst) {
              var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + "enter", to, nativeEvent, nativeEventTarget);
              enterEvent.target = toNode;
              enterEvent.relatedTarget = fromNode;
              enter = enterEvent;
            }
            accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);
          }
          function is(x, y) {
            return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
          }
          var objectIs = typeof Object.is === "function" ? Object.is : is;
          var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
          function shallowEqual(objA, objB) {
            if (objectIs(objA, objB)) {
              return true;
            }
            if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
              return false;
            }
            var keysA = Object.keys(objA);
            var keysB = Object.keys(objB);
            if (keysA.length !== keysB.length) {
              return false;
            }
            for (var i = 0; i < keysA.length; i++) {
              if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {
                return false;
              }
            }
            return true;
          }
          function getLeafNode(node) {
            while (node && node.firstChild) {
              node = node.firstChild;
            }
            return node;
          }
          function getSiblingNode(node) {
            while (node) {
              if (node.nextSibling) {
                return node.nextSibling;
              }
              node = node.parentNode;
            }
          }
          function getNodeForCharacterOffset(root2, offset) {
            var node = getLeafNode(root2);
            var nodeStart = 0;
            var nodeEnd = 0;
            while (node) {
              if (node.nodeType === TEXT_NODE) {
                nodeEnd = nodeStart + node.textContent.length;
                if (nodeStart <= offset && nodeEnd >= offset) {
                  return {
                    node,
                    offset: offset - nodeStart
                  };
                }
                nodeStart = nodeEnd;
              }
              node = getLeafNode(getSiblingNode(node));
            }
          }
          function getOffsets(outerNode) {
            var ownerDocument = outerNode.ownerDocument;
            var win = ownerDocument && ownerDocument.defaultView || window;
            var selection = win.getSelection && win.getSelection();
            if (!selection || selection.rangeCount === 0) {
              return null;
            }
            var anchorNode = selection.anchorNode, anchorOffset = selection.anchorOffset, focusNode = selection.focusNode, focusOffset = selection.focusOffset;
            try {
              anchorNode.nodeType;
              focusNode.nodeType;
            } catch (e) {
              return null;
            }
            return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
          }
          function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
            var length = 0;
            var start = -1;
            var end = -1;
            var indexWithinAnchor = 0;
            var indexWithinFocus = 0;
            var node = outerNode;
            var parentNode = null;
            outer:
              while (true) {
                var next = null;
                while (true) {
                  if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
                    start = length + anchorOffset;
                  }
                  if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
                    end = length + focusOffset;
                  }
                  if (node.nodeType === TEXT_NODE) {
                    length += node.nodeValue.length;
                  }
                  if ((next = node.firstChild) === null) {
                    break;
                  }
                  parentNode = node;
                  node = next;
                }
                while (true) {
                  if (node === outerNode) {
                    break outer;
                  }
                  if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
                    start = length;
                  }
                  if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
                    end = length;
                  }
                  if ((next = node.nextSibling) !== null) {
                    break;
                  }
                  node = parentNode;
                  parentNode = node.parentNode;
                }
                node = next;
              }
            if (start === -1 || end === -1) {
              return null;
            }
            return {
              start,
              end
            };
          }
          function setOffsets(node, offsets) {
            var doc = node.ownerDocument || document;
            var win = doc && doc.defaultView || window;
            if (!win.getSelection) {
              return;
            }
            var selection = win.getSelection();
            var length = node.textContent.length;
            var start = Math.min(offsets.start, length);
            var end = offsets.end === void 0 ? start : Math.min(offsets.end, length);
            if (!selection.extend && start > end) {
              var temp = end;
              end = start;
              start = temp;
            }
            var startMarker = getNodeForCharacterOffset(node, start);
            var endMarker = getNodeForCharacterOffset(node, end);
            if (startMarker && endMarker) {
              if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
                return;
              }
              var range = doc.createRange();
              range.setStart(startMarker.node, startMarker.offset);
              selection.removeAllRanges();
              if (start > end) {
                selection.addRange(range);
                selection.extend(endMarker.node, endMarker.offset);
              } else {
                range.setEnd(endMarker.node, endMarker.offset);
                selection.addRange(range);
              }
            }
          }
          function isTextNode(node) {
            return node && node.nodeType === TEXT_NODE;
          }
          function containsNode(outerNode, innerNode) {
            if (!outerNode || !innerNode) {
              return false;
            } else if (outerNode === innerNode) {
              return true;
            } else if (isTextNode(outerNode)) {
              return false;
            } else if (isTextNode(innerNode)) {
              return containsNode(outerNode, innerNode.parentNode);
            } else if ("contains" in outerNode) {
              return outerNode.contains(innerNode);
            } else if (outerNode.compareDocumentPosition) {
              return !!(outerNode.compareDocumentPosition(innerNode) & 16);
            } else {
              return false;
            }
          }
          function isInDocument(node) {
            return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
          }
          function isSameOriginFrame(iframe) {
            try {
              return typeof iframe.contentWindow.location.href === "string";
            } catch (err) {
              return false;
            }
          }
          function getActiveElementDeep() {
            var win = window;
            var element = getActiveElement();
            while (element instanceof win.HTMLIFrameElement) {
              if (isSameOriginFrame(element)) {
                win = element.contentWindow;
              } else {
                return element;
              }
              element = getActiveElement(win.document);
            }
            return element;
          }
          function hasSelectionCapabilities(elem) {
            var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
            return nodeName && (nodeName === "input" && (elem.type === "text" || elem.type === "search" || elem.type === "tel" || elem.type === "url" || elem.type === "password") || nodeName === "textarea" || elem.contentEditable === "true");
          }
          function getSelectionInformation() {
            var focusedElem = getActiveElementDeep();
            return {
              focusedElem,
              selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
            };
          }
          function restoreSelection(priorSelectionInformation) {
            var curFocusedElem = getActiveElementDeep();
            var priorFocusedElem = priorSelectionInformation.focusedElem;
            var priorSelectionRange = priorSelectionInformation.selectionRange;
            if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
              if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
                setSelection(priorFocusedElem, priorSelectionRange);
              }
              var ancestors = [];
              var ancestor = priorFocusedElem;
              while (ancestor = ancestor.parentNode) {
                if (ancestor.nodeType === ELEMENT_NODE) {
                  ancestors.push({
                    element: ancestor,
                    left: ancestor.scrollLeft,
                    top: ancestor.scrollTop
                  });
                }
              }
              if (typeof priorFocusedElem.focus === "function") {
                priorFocusedElem.focus();
              }
              for (var i = 0; i < ancestors.length; i++) {
                var info = ancestors[i];
                info.element.scrollLeft = info.left;
                info.element.scrollTop = info.top;
              }
            }
          }
          function getSelection(input) {
            var selection;
            if ("selectionStart" in input) {
              selection = {
                start: input.selectionStart,
                end: input.selectionEnd
              };
            } else {
              selection = getOffsets(input);
            }
            return selection || {
              start: 0,
              end: 0
            };
          }
          function setSelection(input, offsets) {
            var start = offsets.start;
            var end = offsets.end;
            if (end === void 0) {
              end = start;
            }
            if ("selectionStart" in input) {
              input.selectionStart = start;
              input.selectionEnd = Math.min(end, input.value.length);
            } else {
              setOffsets(input, offsets);
            }
          }
          var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && document.documentMode <= 11;
          function registerEvents$3() {
            registerTwoPhaseEvent("onSelect", ["focusout", "contextmenu", "dragend", "focusin", "keydown", "keyup", "mousedown", "mouseup", "selectionchange"]);
          }
          var activeElement$1 = null;
          var activeElementInst$1 = null;
          var lastSelection = null;
          var mouseDown = false;
          function getSelection$1(node) {
            if ("selectionStart" in node && hasSelectionCapabilities(node)) {
              return {
                start: node.selectionStart,
                end: node.selectionEnd
              };
            } else {
              var win = node.ownerDocument && node.ownerDocument.defaultView || window;
              var selection = win.getSelection();
              return {
                anchorNode: selection.anchorNode,
                anchorOffset: selection.anchorOffset,
                focusNode: selection.focusNode,
                focusOffset: selection.focusOffset
              };
            }
          }
          function getEventTargetDocument(eventTarget) {
            return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
          }
          function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
            var doc = getEventTargetDocument(nativeEventTarget);
            if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
              return;
            }
            var currentSelection = getSelection$1(activeElement$1);
            if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
              lastSelection = currentSelection;
              var listeners = accumulateTwoPhaseListeners(activeElementInst$1, "onSelect");
              if (listeners.length > 0) {
                var event = new SyntheticEvent("onSelect", "select", null, nativeEvent, nativeEventTarget);
                dispatchQueue.push({
                  event,
                  listeners
                });
                event.target = activeElement$1;
              }
            }
          }
          function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
            switch (domEventName) {
              case "focusin":
                if (isTextInputElement(targetNode) || targetNode.contentEditable === "true") {
                  activeElement$1 = targetNode;
                  activeElementInst$1 = targetInst;
                  lastSelection = null;
                }
                break;
              case "focusout":
                activeElement$1 = null;
                activeElementInst$1 = null;
                lastSelection = null;
                break;
              case "mousedown":
                mouseDown = true;
                break;
              case "contextmenu":
              case "mouseup":
              case "dragend":
                mouseDown = false;
                constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
                break;
              case "selectionchange":
                if (skipSelectionChangeEvent) {
                  break;
                }
              case "keydown":
              case "keyup":
                constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
            }
          }
          function extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var reactName = topLevelEventsToReactNames.get(domEventName);
            if (reactName === void 0) {
              return;
            }
            var SyntheticEventCtor = SyntheticEvent;
            var reactEventType = domEventName;
            switch (domEventName) {
              case "keypress":
                if (getEventCharCode(nativeEvent) === 0) {
                  return;
                }
              case "keydown":
              case "keyup":
                SyntheticEventCtor = SyntheticKeyboardEvent;
                break;
              case "focusin":
                reactEventType = "focus";
                SyntheticEventCtor = SyntheticFocusEvent;
                break;
              case "focusout":
                reactEventType = "blur";
                SyntheticEventCtor = SyntheticFocusEvent;
                break;
              case "beforeblur":
              case "afterblur":
                SyntheticEventCtor = SyntheticFocusEvent;
                break;
              case "click":
                if (nativeEvent.button === 2) {
                  return;
                }
              case "auxclick":
              case "dblclick":
              case "mousedown":
              case "mousemove":
              case "mouseup":
              case "mouseout":
              case "mouseover":
              case "contextmenu":
                SyntheticEventCtor = SyntheticMouseEvent;
                break;
              case "drag":
              case "dragend":
              case "dragenter":
              case "dragexit":
              case "dragleave":
              case "dragover":
              case "dragstart":
              case "drop":
                SyntheticEventCtor = SyntheticDragEvent;
                break;
              case "touchcancel":
              case "touchend":
              case "touchmove":
              case "touchstart":
                SyntheticEventCtor = SyntheticTouchEvent;
                break;
              case ANIMATION_END:
              case ANIMATION_ITERATION:
              case ANIMATION_START:
                SyntheticEventCtor = SyntheticAnimationEvent;
                break;
              case TRANSITION_END:
                SyntheticEventCtor = SyntheticTransitionEvent;
                break;
              case "scroll":
                SyntheticEventCtor = SyntheticUIEvent;
                break;
              case "wheel":
                SyntheticEventCtor = SyntheticWheelEvent;
                break;
              case "copy":
              case "cut":
              case "paste":
                SyntheticEventCtor = SyntheticClipboardEvent;
                break;
              case "gotpointercapture":
              case "lostpointercapture":
              case "pointercancel":
              case "pointerdown":
              case "pointermove":
              case "pointerout":
              case "pointerover":
              case "pointerup":
                SyntheticEventCtor = SyntheticPointerEvent;
                break;
            }
            var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
            {
              var accumulateTargetOnly = !inCapturePhase && domEventName === "scroll";
              var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);
              if (_listeners.length > 0) {
                var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);
                dispatchQueue.push({
                  event: _event,
                  listeners: _listeners
                });
              }
            }
          }
          registerSimpleEvents();
          registerEvents$2();
          registerEvents$1();
          registerEvents$3();
          registerEvents();
          function extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
            var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0;
            if (shouldProcessPolyfillPlugins) {
              extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
              extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
              extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
              extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
            }
          }
          var mediaEventTypes = ["abort", "canplay", "canplaythrough", "durationchange", "emptied", "encrypted", "ended", "error", "loadeddata", "loadedmetadata", "loadstart", "pause", "play", "playing", "progress", "ratechange", "seeked", "seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"];
          var nonDelegatedEvents = new Set(["cancel", "close", "invalid", "load", "scroll", "toggle"].concat(mediaEventTypes));
          function executeDispatch(event, listener, currentTarget) {
            var type = event.type || "unknown-event";
            event.currentTarget = currentTarget;
            invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event);
            event.currentTarget = null;
          }
          function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) {
            var previousInstance;
            if (inCapturePhase) {
              for (var i = dispatchListeners.length - 1; i >= 0; i--) {
                var _dispatchListeners$i = dispatchListeners[i], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget, listener = _dispatchListeners$i.listener;
                if (instance !== previousInstance && event.isPropagationStopped()) {
                  return;
                }
                executeDispatch(event, listener, currentTarget);
                previousInstance = instance;
              }
            } else {
              for (var _i = 0; _i < dispatchListeners.length; _i++) {
                var _dispatchListeners$_i = dispatchListeners[_i], _instance = _dispatchListeners$_i.instance, _currentTarget = _dispatchListeners$_i.currentTarget, _listener = _dispatchListeners$_i.listener;
                if (_instance !== previousInstance && event.isPropagationStopped()) {
                  return;
                }
                executeDispatch(event, _listener, _currentTarget);
                previousInstance = _instance;
              }
            }
          }
          function processDispatchQueue(dispatchQueue, eventSystemFlags) {
            var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
            for (var i = 0; i < dispatchQueue.length; i++) {
              var _dispatchQueue$i = dispatchQueue[i], event = _dispatchQueue$i.event, listeners = _dispatchQueue$i.listeners;
              processDispatchQueueItemsInOrder(event, listeners, inCapturePhase);
            }
            rethrowCaughtError();
          }
          function dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
            var nativeEventTarget = getEventTarget(nativeEvent);
            var dispatchQueue = [];
            extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
            processDispatchQueue(dispatchQueue, eventSystemFlags);
          }
          function listenToNonDelegatedEvent(domEventName, targetElement) {
            var isCapturePhaseListener = false;
            var listenerSet = getEventListenerSet(targetElement);
            var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);
            if (!listenerSet.has(listenerSetKey)) {
              addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);
              listenerSet.add(listenerSetKey);
            }
          }
          var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2);
          function listenToAllSupportedEvents(rootContainerElement) {
            {
              if (rootContainerElement[listeningMarker]) {
                return;
              }
              rootContainerElement[listeningMarker] = true;
              allNativeEvents.forEach(function(domEventName) {
                if (!nonDelegatedEvents.has(domEventName)) {
                  listenToNativeEvent(domEventName, false, rootContainerElement, null);
                }
                listenToNativeEvent(domEventName, true, rootContainerElement, null);
              });
            }
          }
          function listenToNativeEvent(domEventName, isCapturePhaseListener, rootContainerElement, targetElement) {
            var eventSystemFlags = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0;
            var target = rootContainerElement;
            if (domEventName === "selectionchange" && rootContainerElement.nodeType !== DOCUMENT_NODE) {
              target = rootContainerElement.ownerDocument;
            }
            if (targetElement !== null && !isCapturePhaseListener && nonDelegatedEvents.has(domEventName)) {
              if (domEventName !== "scroll") {
                return;
              }
              eventSystemFlags |= IS_NON_DELEGATED;
              target = targetElement;
            }
            var listenerSet = getEventListenerSet(target);
            var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);
            if (!listenerSet.has(listenerSetKey)) {
              if (isCapturePhaseListener) {
                eventSystemFlags |= IS_CAPTURE_PHASE;
              }
              addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);
              listenerSet.add(listenerSetKey);
            }
          }
          function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {
            var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags);
            var isPassiveListener = void 0;
            if (passiveBrowserEventsSupported) {
              if (domEventName === "touchstart" || domEventName === "touchmove" || domEventName === "wheel") {
                isPassiveListener = true;
              }
            }
            targetContainer = targetContainer;
            var unsubscribeListener;
            if (isCapturePhaseListener) {
              if (isPassiveListener !== void 0) {
                unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
              } else {
                unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener);
              }
            } else {
              if (isPassiveListener !== void 0) {
                unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
              } else {
                unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener);
              }
            }
          }
          function isMatchingRootContainer(grandContainer, targetContainer) {
            return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer;
          }
          function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
            var ancestorInst = targetInst;
            if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) {
              var targetContainerNode = targetContainer;
              if (targetInst !== null) {
                var node = targetInst;
                mainLoop:
                  while (true) {
                    if (node === null) {
                      return;
                    }
                    var nodeTag = node.tag;
                    if (nodeTag === HostRoot || nodeTag === HostPortal) {
                      var container = node.stateNode.containerInfo;
                      if (isMatchingRootContainer(container, targetContainerNode)) {
                        break;
                      }
                      if (nodeTag === HostPortal) {
                        var grandNode = node.return;
                        while (grandNode !== null) {
                          var grandTag = grandNode.tag;
                          if (grandTag === HostRoot || grandTag === HostPortal) {
                            var grandContainer = grandNode.stateNode.containerInfo;
                            if (isMatchingRootContainer(grandContainer, targetContainerNode)) {
                              return;
                            }
                          }
                          grandNode = grandNode.return;
                        }
                      }
                      while (container !== null) {
                        var parentNode = getClosestInstanceFromNode(container);
                        if (parentNode === null) {
                          return;
                        }
                        var parentTag = parentNode.tag;
                        if (parentTag === HostComponent || parentTag === HostText) {
                          node = ancestorInst = parentNode;
                          continue mainLoop;
                        }
                        container = container.parentNode;
                      }
                    }
                    node = node.return;
                  }
              }
            }
            batchedEventUpdates(function() {
              return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);
            });
          }
          function createDispatchListener(instance, listener, currentTarget) {
            return {
              instance,
              listener,
              currentTarget
            };
          }
          function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly) {
            var captureName = reactName !== null ? reactName + "Capture" : null;
            var reactEventName = inCapturePhase ? captureName : reactName;
            var listeners = [];
            var instance = targetFiber;
            var lastHostComponent = null;
            while (instance !== null) {
              var _instance2 = instance, stateNode = _instance2.stateNode, tag = _instance2.tag;
              if (tag === HostComponent && stateNode !== null) {
                lastHostComponent = stateNode;
                if (reactEventName !== null) {
                  var listener = getListener(instance, reactEventName);
                  if (listener != null) {
                    listeners.push(createDispatchListener(instance, listener, lastHostComponent));
                  }
                }
              }
              if (accumulateTargetOnly) {
                break;
              }
              instance = instance.return;
            }
            return listeners;
          }
          function accumulateTwoPhaseListeners(targetFiber, reactName) {
            var captureName = reactName + "Capture";
            var listeners = [];
            var instance = targetFiber;
            while (instance !== null) {
              var _instance3 = instance, stateNode = _instance3.stateNode, tag = _instance3.tag;
              if (tag === HostComponent && stateNode !== null) {
                var currentTarget = stateNode;
                var captureListener = getListener(instance, captureName);
                if (captureListener != null) {
                  listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
                }
                var bubbleListener = getListener(instance, reactName);
                if (bubbleListener != null) {
                  listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
                }
              }
              instance = instance.return;
            }
            return listeners;
          }
          function getParent(inst) {
            if (inst === null) {
              return null;
            }
            do {
              inst = inst.return;
            } while (inst && inst.tag !== HostComponent);
            if (inst) {
              return inst;
            }
            return null;
          }
          function getLowestCommonAncestor(instA, instB) {
            var nodeA = instA;
            var nodeB = instB;
            var depthA = 0;
            for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {
              depthA++;
            }
            var depthB = 0;
            for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {
              depthB++;
            }
            while (depthA - depthB > 0) {
              nodeA = getParent(nodeA);
              depthA--;
            }
            while (depthB - depthA > 0) {
              nodeB = getParent(nodeB);
              depthB--;
            }
            var depth = depthA;
            while (depth--) {
              if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {
                return nodeA;
              }
              nodeA = getParent(nodeA);
              nodeB = getParent(nodeB);
            }
            return null;
          }
          function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {
            var registrationName = event._reactName;
            var listeners = [];
            var instance = target;
            while (instance !== null) {
              if (instance === common) {
                break;
              }
              var _instance4 = instance, alternate = _instance4.alternate, stateNode = _instance4.stateNode, tag = _instance4.tag;
              if (alternate !== null && alternate === common) {
                break;
              }
              if (tag === HostComponent && stateNode !== null) {
                var currentTarget = stateNode;
                if (inCapturePhase) {
                  var captureListener = getListener(instance, registrationName);
                  if (captureListener != null) {
                    listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
                  }
                } else if (!inCapturePhase) {
                  var bubbleListener = getListener(instance, registrationName);
                  if (bubbleListener != null) {
                    listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
                  }
                }
              }
              instance = instance.return;
            }
            if (listeners.length !== 0) {
              dispatchQueue.push({
                event,
                listeners
              });
            }
          }
          function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {
            var common = from && to ? getLowestCommonAncestor(from, to) : null;
            if (from !== null) {
              accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);
            }
            if (to !== null && enterEvent !== null) {
              accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);
            }
          }
          function getListenerSetKey(domEventName, capture) {
            return domEventName + "__" + (capture ? "capture" : "bubble");
          }
          var didWarnInvalidHydration = false;
          var DANGEROUSLY_SET_INNER_HTML = "dangerouslySetInnerHTML";
          var SUPPRESS_CONTENT_EDITABLE_WARNING = "suppressContentEditableWarning";
          var SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning";
          var AUTOFOCUS = "autoFocus";
          var CHILDREN = "children";
          var STYLE = "style";
          var HTML$1 = "__html";
          var HTML_NAMESPACE$1 = Namespaces.html;
          var warnedUnknownTags;
          var suppressHydrationWarning;
          var validatePropertiesInDevelopment;
          var warnForTextDifference;
          var warnForPropDifference;
          var warnForExtraAttributes;
          var warnForInvalidEventListener;
          var canDiffStyleForHydrationWarning;
          var normalizeMarkupForTextOrAttribute;
          var normalizeHTML;
          {
            warnedUnknownTags = {
              dialog: true,
              webview: true
            };
            validatePropertiesInDevelopment = function(type, props) {
              validateProperties(type, props);
              validateProperties$1(type, props);
              validateProperties$2(type, props, {
                registrationNameDependencies,
                possibleRegistrationNames
              });
            };
            canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;
            var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
            var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
            normalizeMarkupForTextOrAttribute = function(markup) {
              var markupString = typeof markup === "string" ? markup : "" + markup;
              return markupString.replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
            };
            warnForTextDifference = function(serverText, clientText) {
              if (didWarnInvalidHydration) {
                return;
              }
              var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
              var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
              if (normalizedServerText === normalizedClientText) {
                return;
              }
              didWarnInvalidHydration = true;
              error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
            };
            warnForPropDifference = function(propName, serverValue, clientValue) {
              if (didWarnInvalidHydration) {
                return;
              }
              var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
              var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
              if (normalizedServerValue === normalizedClientValue) {
                return;
              }
              didWarnInvalidHydration = true;
              error("Prop `%s` did not match. Server: %s Client: %s", propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
            };
            warnForExtraAttributes = function(attributeNames) {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              var names = [];
              attributeNames.forEach(function(name) {
                names.push(name);
              });
              error("Extra attributes from the server: %s", names);
            };
            warnForInvalidEventListener = function(registrationName, listener) {
              if (listener === false) {
                error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.", registrationName, registrationName, registrationName);
              } else {
                error("Expected `%s` listener to be a function, instead got a value of `%s` type.", registrationName, typeof listener);
              }
            };
            normalizeHTML = function(parent, html) {
              var testElement = parent.namespaceURI === HTML_NAMESPACE$1 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
              testElement.innerHTML = html;
              return testElement.innerHTML;
            };
          }
          function getOwnerDocumentFromRootContainer(rootContainerElement) {
            return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
          }
          function noop() {
          }
          function trapClickOnNonInteractiveElement(node) {
            node.onclick = noop;
          }
          function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
            for (var propKey in nextProps) {
              if (!nextProps.hasOwnProperty(propKey)) {
                continue;
              }
              var nextProp = nextProps[propKey];
              if (propKey === STYLE) {
                {
                  if (nextProp) {
                    Object.freeze(nextProp);
                  }
                }
                setValueForStyles(domElement, nextProp);
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
                if (nextHtml != null) {
                  setInnerHTML(domElement, nextHtml);
                }
              } else if (propKey === CHILDREN) {
                if (typeof nextProp === "string") {
                  var canSetTextContent = tag !== "textarea" || nextProp !== "";
                  if (canSetTextContent) {
                    setTextContent(domElement, nextProp);
                  }
                } else if (typeof nextProp === "number") {
                  setTextContent(domElement, "" + nextProp);
                }
              } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
                ;
              else if (propKey === AUTOFOCUS)
                ;
              else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (nextProp != null) {
                  if (typeof nextProp !== "function") {
                    warnForInvalidEventListener(propKey, nextProp);
                  }
                  if (propKey === "onScroll") {
                    listenToNonDelegatedEvent("scroll", domElement);
                  }
                }
              } else if (nextProp != null) {
                setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
              }
            }
          }
          function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
            for (var i = 0; i < updatePayload.length; i += 2) {
              var propKey = updatePayload[i];
              var propValue = updatePayload[i + 1];
              if (propKey === STYLE) {
                setValueForStyles(domElement, propValue);
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                setInnerHTML(domElement, propValue);
              } else if (propKey === CHILDREN) {
                setTextContent(domElement, propValue);
              } else {
                setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
              }
            }
          }
          function createElement3(type, props, rootContainerElement, parentNamespace) {
            var isCustomComponentTag;
            var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
            var domElement;
            var namespaceURI = parentNamespace;
            if (namespaceURI === HTML_NAMESPACE$1) {
              namespaceURI = getIntrinsicNamespace(type);
            }
            if (namespaceURI === HTML_NAMESPACE$1) {
              {
                isCustomComponentTag = isCustomComponent(type, props);
                if (!isCustomComponentTag && type !== type.toLowerCase()) {
                  error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", type);
                }
              }
              if (type === "script") {
                var div2 = ownerDocument.createElement("div");
                div2.innerHTML = "<script><\/script>";
                var firstChild = div2.firstChild;
                domElement = div2.removeChild(firstChild);
              } else if (typeof props.is === "string") {
                domElement = ownerDocument.createElement(type, {
                  is: props.is
                });
              } else {
                domElement = ownerDocument.createElement(type);
                if (type === "select") {
                  var node = domElement;
                  if (props.multiple) {
                    node.multiple = true;
                  } else if (props.size) {
                    node.size = props.size;
                  }
                }
              }
            } else {
              domElement = ownerDocument.createElementNS(namespaceURI, type);
            }
            {
              if (namespaceURI === HTML_NAMESPACE$1) {
                if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === "[object HTMLUnknownElement]" && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
                  warnedUnknownTags[type] = true;
                  error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.", type);
                }
              }
            }
            return domElement;
          }
          function createTextNode(text, rootContainerElement) {
            return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
          }
          function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
            var isCustomComponentTag = isCustomComponent(tag, rawProps);
            {
              validatePropertiesInDevelopment(tag, rawProps);
            }
            var props;
            switch (tag) {
              case "dialog":
                listenToNonDelegatedEvent("cancel", domElement);
                listenToNonDelegatedEvent("close", domElement);
                props = rawProps;
                break;
              case "iframe":
              case "object":
              case "embed":
                listenToNonDelegatedEvent("load", domElement);
                props = rawProps;
                break;
              case "video":
              case "audio":
                for (var i = 0; i < mediaEventTypes.length; i++) {
                  listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
                }
                props = rawProps;
                break;
              case "source":
                listenToNonDelegatedEvent("error", domElement);
                props = rawProps;
                break;
              case "img":
              case "image":
              case "link":
                listenToNonDelegatedEvent("error", domElement);
                listenToNonDelegatedEvent("load", domElement);
                props = rawProps;
                break;
              case "details":
                listenToNonDelegatedEvent("toggle", domElement);
                props = rawProps;
                break;
              case "input":
                initWrapperState(domElement, rawProps);
                props = getHostProps(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "option":
                validateProps(domElement, rawProps);
                props = getHostProps$1(domElement, rawProps);
                break;
              case "select":
                initWrapperState$1(domElement, rawProps);
                props = getHostProps$2(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "textarea":
                initWrapperState$2(domElement, rawProps);
                props = getHostProps$3(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              default:
                props = rawProps;
            }
            assertValidProps(tag, props);
            setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
            switch (tag) {
              case "input":
                track(domElement);
                postMountWrapper(domElement, rawProps, false);
                break;
              case "textarea":
                track(domElement);
                postMountWrapper$3(domElement);
                break;
              case "option":
                postMountWrapper$1(domElement, rawProps);
                break;
              case "select":
                postMountWrapper$2(domElement, rawProps);
                break;
              default:
                if (typeof props.onClick === "function") {
                  trapClickOnNonInteractiveElement(domElement);
                }
                break;
            }
          }
          function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
            {
              validatePropertiesInDevelopment(tag, nextRawProps);
            }
            var updatePayload = null;
            var lastProps;
            var nextProps;
            switch (tag) {
              case "input":
                lastProps = getHostProps(domElement, lastRawProps);
                nextProps = getHostProps(domElement, nextRawProps);
                updatePayload = [];
                break;
              case "option":
                lastProps = getHostProps$1(domElement, lastRawProps);
                nextProps = getHostProps$1(domElement, nextRawProps);
                updatePayload = [];
                break;
              case "select":
                lastProps = getHostProps$2(domElement, lastRawProps);
                nextProps = getHostProps$2(domElement, nextRawProps);
                updatePayload = [];
                break;
              case "textarea":
                lastProps = getHostProps$3(domElement, lastRawProps);
                nextProps = getHostProps$3(domElement, nextRawProps);
                updatePayload = [];
                break;
              default:
                lastProps = lastRawProps;
                nextProps = nextRawProps;
                if (typeof lastProps.onClick !== "function" && typeof nextProps.onClick === "function") {
                  trapClickOnNonInteractiveElement(domElement);
                }
                break;
            }
            assertValidProps(tag, nextProps);
            var propKey;
            var styleName;
            var styleUpdates = null;
            for (propKey in lastProps) {
              if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
                continue;
              }
              if (propKey === STYLE) {
                var lastStyle = lastProps[propKey];
                for (styleName in lastStyle) {
                  if (lastStyle.hasOwnProperty(styleName)) {
                    if (!styleUpdates) {
                      styleUpdates = {};
                    }
                    styleUpdates[styleName] = "";
                  }
                }
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN)
                ;
              else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
                ;
              else if (propKey === AUTOFOCUS)
                ;
              else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (!updatePayload) {
                  updatePayload = [];
                }
              } else {
                (updatePayload = updatePayload || []).push(propKey, null);
              }
            }
            for (propKey in nextProps) {
              var nextProp = nextProps[propKey];
              var lastProp = lastProps != null ? lastProps[propKey] : void 0;
              if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
                continue;
              }
              if (propKey === STYLE) {
                {
                  if (nextProp) {
                    Object.freeze(nextProp);
                  }
                }
                if (lastProp) {
                  for (styleName in lastProp) {
                    if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
                      if (!styleUpdates) {
                        styleUpdates = {};
                      }
                      styleUpdates[styleName] = "";
                    }
                  }
                  for (styleName in nextProp) {
                    if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
                      if (!styleUpdates) {
                        styleUpdates = {};
                      }
                      styleUpdates[styleName] = nextProp[styleName];
                    }
                  }
                } else {
                  if (!styleUpdates) {
                    if (!updatePayload) {
                      updatePayload = [];
                    }
                    updatePayload.push(propKey, styleUpdates);
                  }
                  styleUpdates = nextProp;
                }
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
                var lastHtml = lastProp ? lastProp[HTML$1] : void 0;
                if (nextHtml != null) {
                  if (lastHtml !== nextHtml) {
                    (updatePayload = updatePayload || []).push(propKey, nextHtml);
                  }
                }
              } else if (propKey === CHILDREN) {
                if (typeof nextProp === "string" || typeof nextProp === "number") {
                  (updatePayload = updatePayload || []).push(propKey, "" + nextProp);
                }
              } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
                ;
              else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (nextProp != null) {
                  if (typeof nextProp !== "function") {
                    warnForInvalidEventListener(propKey, nextProp);
                  }
                  if (propKey === "onScroll") {
                    listenToNonDelegatedEvent("scroll", domElement);
                  }
                }
                if (!updatePayload && lastProp !== nextProp) {
                  updatePayload = [];
                }
              } else if (typeof nextProp === "object" && nextProp !== null && nextProp.$$typeof === REACT_OPAQUE_ID_TYPE) {
                nextProp.toString();
              } else {
                (updatePayload = updatePayload || []).push(propKey, nextProp);
              }
            }
            if (styleUpdates) {
              {
                validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);
              }
              (updatePayload = updatePayload || []).push(STYLE, styleUpdates);
            }
            return updatePayload;
          }
          function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
            if (tag === "input" && nextRawProps.type === "radio" && nextRawProps.name != null) {
              updateChecked(domElement, nextRawProps);
            }
            var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
            var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
            updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
            switch (tag) {
              case "input":
                updateWrapper(domElement, nextRawProps);
                break;
              case "textarea":
                updateWrapper$1(domElement, nextRawProps);
                break;
              case "select":
                postUpdateWrapper(domElement, nextRawProps);
                break;
            }
          }
          function getPossibleStandardName(propName) {
            {
              var lowerCasedName = propName.toLowerCase();
              if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
                return null;
              }
              return possibleStandardNames[lowerCasedName] || null;
            }
          }
          function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
            var isCustomComponentTag;
            var extraAttributeNames;
            {
              suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;
              isCustomComponentTag = isCustomComponent(tag, rawProps);
              validatePropertiesInDevelopment(tag, rawProps);
            }
            switch (tag) {
              case "dialog":
                listenToNonDelegatedEvent("cancel", domElement);
                listenToNonDelegatedEvent("close", domElement);
                break;
              case "iframe":
              case "object":
              case "embed":
                listenToNonDelegatedEvent("load", domElement);
                break;
              case "video":
              case "audio":
                for (var i = 0; i < mediaEventTypes.length; i++) {
                  listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
                }
                break;
              case "source":
                listenToNonDelegatedEvent("error", domElement);
                break;
              case "img":
              case "image":
              case "link":
                listenToNonDelegatedEvent("error", domElement);
                listenToNonDelegatedEvent("load", domElement);
                break;
              case "details":
                listenToNonDelegatedEvent("toggle", domElement);
                break;
              case "input":
                initWrapperState(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "option":
                validateProps(domElement, rawProps);
                break;
              case "select":
                initWrapperState$1(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "textarea":
                initWrapperState$2(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
            }
            assertValidProps(tag, rawProps);
            {
              extraAttributeNames = /* @__PURE__ */ new Set();
              var attributes = domElement.attributes;
              for (var _i = 0; _i < attributes.length; _i++) {
                var name = attributes[_i].name.toLowerCase();
                switch (name) {
                  case "data-reactroot":
                    break;
                  case "value":
                    break;
                  case "checked":
                    break;
                  case "selected":
                    break;
                  default:
                    extraAttributeNames.add(attributes[_i].name);
                }
              }
            }
            var updatePayload = null;
            for (var propKey in rawProps) {
              if (!rawProps.hasOwnProperty(propKey)) {
                continue;
              }
              var nextProp = rawProps[propKey];
              if (propKey === CHILDREN) {
                if (typeof nextProp === "string") {
                  if (domElement.textContent !== nextProp) {
                    if (!suppressHydrationWarning) {
                      warnForTextDifference(domElement.textContent, nextProp);
                    }
                    updatePayload = [CHILDREN, nextProp];
                  }
                } else if (typeof nextProp === "number") {
                  if (domElement.textContent !== "" + nextProp) {
                    if (!suppressHydrationWarning) {
                      warnForTextDifference(domElement.textContent, nextProp);
                    }
                    updatePayload = [CHILDREN, "" + nextProp];
                  }
                }
              } else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (nextProp != null) {
                  if (typeof nextProp !== "function") {
                    warnForInvalidEventListener(propKey, nextProp);
                  }
                  if (propKey === "onScroll") {
                    listenToNonDelegatedEvent("scroll", domElement);
                  }
                }
              } else if (typeof isCustomComponentTag === "boolean") {
                var serverValue = void 0;
                var propertyInfo = getPropertyInfo(propKey);
                if (suppressHydrationWarning)
                  ;
                else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || propKey === "value" || propKey === "checked" || propKey === "selected")
                  ;
                else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                  var serverHTML = domElement.innerHTML;
                  var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
                  if (nextHtml != null) {
                    var expectedHTML = normalizeHTML(domElement, nextHtml);
                    if (expectedHTML !== serverHTML) {
                      warnForPropDifference(propKey, serverHTML, expectedHTML);
                    }
                  }
                } else if (propKey === STYLE) {
                  extraAttributeNames.delete(propKey);
                  if (canDiffStyleForHydrationWarning) {
                    var expectedStyle = createDangerousStringForStyles(nextProp);
                    serverValue = domElement.getAttribute("style");
                    if (expectedStyle !== serverValue) {
                      warnForPropDifference(propKey, serverValue, expectedStyle);
                    }
                  }
                } else if (isCustomComponentTag) {
                  extraAttributeNames.delete(propKey.toLowerCase());
                  serverValue = getValueForAttribute(domElement, propKey, nextProp);
                  if (nextProp !== serverValue) {
                    warnForPropDifference(propKey, serverValue, nextProp);
                  }
                } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
                  var isMismatchDueToBadCasing = false;
                  if (propertyInfo !== null) {
                    extraAttributeNames.delete(propertyInfo.attributeName);
                    serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
                  } else {
                    var ownNamespace = parentNamespace;
                    if (ownNamespace === HTML_NAMESPACE$1) {
                      ownNamespace = getIntrinsicNamespace(tag);
                    }
                    if (ownNamespace === HTML_NAMESPACE$1) {
                      extraAttributeNames.delete(propKey.toLowerCase());
                    } else {
                      var standardName = getPossibleStandardName(propKey);
                      if (standardName !== null && standardName !== propKey) {
                        isMismatchDueToBadCasing = true;
                        extraAttributeNames.delete(standardName);
                      }
                      extraAttributeNames.delete(propKey);
                    }
                    serverValue = getValueForAttribute(domElement, propKey, nextProp);
                  }
                  if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
                    warnForPropDifference(propKey, serverValue, nextProp);
                  }
                }
              }
            }
            {
              if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
                warnForExtraAttributes(extraAttributeNames);
              }
            }
            switch (tag) {
              case "input":
                track(domElement);
                postMountWrapper(domElement, rawProps, true);
                break;
              case "textarea":
                track(domElement);
                postMountWrapper$3(domElement);
                break;
              case "select":
              case "option":
                break;
              default:
                if (typeof rawProps.onClick === "function") {
                  trapClickOnNonInteractiveElement(domElement);
                }
                break;
            }
            return updatePayload;
          }
          function diffHydratedText(textNode, text) {
            var isDifferent = textNode.nodeValue !== text;
            return isDifferent;
          }
          function warnForUnmatchedText(textNode, text) {
            {
              warnForTextDifference(textNode.nodeValue, text);
            }
          }
          function warnForDeletedHydratableElement(parentNode, child) {
            {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error("Did not expect server HTML to contain a <%s> in <%s>.", child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
            }
          }
          function warnForDeletedHydratableText(parentNode, child) {
            {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
            }
          }
          function warnForInsertedHydratedElement(parentNode, tag, props) {
            {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error("Expected server HTML to contain a matching <%s> in <%s>.", tag, parentNode.nodeName.toLowerCase());
            }
          }
          function warnForInsertedHydratedText(parentNode, text) {
            {
              if (text === "") {
                return;
              }
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
            }
          }
          function restoreControlledState$3(domElement, tag, props) {
            switch (tag) {
              case "input":
                restoreControlledState(domElement, props);
                return;
              case "textarea":
                restoreControlledState$2(domElement, props);
                return;
              case "select":
                restoreControlledState$1(domElement, props);
                return;
            }
          }
          var validateDOMNesting = function() {
          };
          var updatedAncestorInfo = function() {
          };
          {
            var specialTags = ["address", "applet", "area", "article", "aside", "base", "basefont", "bgsound", "blockquote", "body", "br", "button", "caption", "center", "col", "colgroup", "dd", "details", "dir", "div", "dl", "dt", "embed", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "isindex", "li", "link", "listing", "main", "marquee", "menu", "menuitem", "meta", "nav", "noembed", "noframes", "noscript", "object", "ol", "p", "param", "plaintext", "pre", "script", "section", "select", "source", "style", "summary", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "title", "tr", "track", "ul", "wbr", "xmp"];
            var inScopeTags = [
              "applet",
              "caption",
              "html",
              "table",
              "td",
              "th",
              "marquee",
              "object",
              "template",
              "foreignObject",
              "desc",
              "title"
            ];
            var buttonScopeTags = inScopeTags.concat(["button"]);
            var impliedEndTags = ["dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"];
            var emptyAncestorInfo = {
              current: null,
              formTag: null,
              aTagInScope: null,
              buttonTagInScope: null,
              nobrTagInScope: null,
              pTagInButtonScope: null,
              listItemTagAutoclosing: null,
              dlItemTagAutoclosing: null
            };
            updatedAncestorInfo = function(oldInfo, tag) {
              var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
              var info = {
                tag
              };
              if (inScopeTags.indexOf(tag) !== -1) {
                ancestorInfo.aTagInScope = null;
                ancestorInfo.buttonTagInScope = null;
                ancestorInfo.nobrTagInScope = null;
              }
              if (buttonScopeTags.indexOf(tag) !== -1) {
                ancestorInfo.pTagInButtonScope = null;
              }
              if (specialTags.indexOf(tag) !== -1 && tag !== "address" && tag !== "div" && tag !== "p") {
                ancestorInfo.listItemTagAutoclosing = null;
                ancestorInfo.dlItemTagAutoclosing = null;
              }
              ancestorInfo.current = info;
              if (tag === "form") {
                ancestorInfo.formTag = info;
              }
              if (tag === "a") {
                ancestorInfo.aTagInScope = info;
              }
              if (tag === "button") {
                ancestorInfo.buttonTagInScope = info;
              }
              if (tag === "nobr") {
                ancestorInfo.nobrTagInScope = info;
              }
              if (tag === "p") {
                ancestorInfo.pTagInButtonScope = info;
              }
              if (tag === "li") {
                ancestorInfo.listItemTagAutoclosing = info;
              }
              if (tag === "dd" || tag === "dt") {
                ancestorInfo.dlItemTagAutoclosing = info;
              }
              return ancestorInfo;
            };
            var isTagValidWithParent = function(tag, parentTag) {
              switch (parentTag) {
                case "select":
                  return tag === "option" || tag === "optgroup" || tag === "#text";
                case "optgroup":
                  return tag === "option" || tag === "#text";
                case "option":
                  return tag === "#text";
                case "tr":
                  return tag === "th" || tag === "td" || tag === "style" || tag === "script" || tag === "template";
                case "tbody":
                case "thead":
                case "tfoot":
                  return tag === "tr" || tag === "style" || tag === "script" || tag === "template";
                case "colgroup":
                  return tag === "col" || tag === "template";
                case "table":
                  return tag === "caption" || tag === "colgroup" || tag === "tbody" || tag === "tfoot" || tag === "thead" || tag === "style" || tag === "script" || tag === "template";
                case "head":
                  return tag === "base" || tag === "basefont" || tag === "bgsound" || tag === "link" || tag === "meta" || tag === "title" || tag === "noscript" || tag === "noframes" || tag === "style" || tag === "script" || tag === "template";
                case "html":
                  return tag === "head" || tag === "body" || tag === "frameset";
                case "frameset":
                  return tag === "frame";
                case "#document":
                  return tag === "html";
              }
              switch (tag) {
                case "h1":
                case "h2":
                case "h3":
                case "h4":
                case "h5":
                case "h6":
                  return parentTag !== "h1" && parentTag !== "h2" && parentTag !== "h3" && parentTag !== "h4" && parentTag !== "h5" && parentTag !== "h6";
                case "rp":
                case "rt":
                  return impliedEndTags.indexOf(parentTag) === -1;
                case "body":
                case "caption":
                case "col":
                case "colgroup":
                case "frameset":
                case "frame":
                case "head":
                case "html":
                case "tbody":
                case "td":
                case "tfoot":
                case "th":
                case "thead":
                case "tr":
                  return parentTag == null;
              }
              return true;
            };
            var findInvalidAncestorForTag = function(tag, ancestorInfo) {
              switch (tag) {
                case "address":
                case "article":
                case "aside":
                case "blockquote":
                case "center":
                case "details":
                case "dialog":
                case "dir":
                case "div":
                case "dl":
                case "fieldset":
                case "figcaption":
                case "figure":
                case "footer":
                case "header":
                case "hgroup":
                case "main":
                case "menu":
                case "nav":
                case "ol":
                case "p":
                case "section":
                case "summary":
                case "ul":
                case "pre":
                case "listing":
                case "table":
                case "hr":
                case "xmp":
                case "h1":
                case "h2":
                case "h3":
                case "h4":
                case "h5":
                case "h6":
                  return ancestorInfo.pTagInButtonScope;
                case "form":
                  return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
                case "li":
                  return ancestorInfo.listItemTagAutoclosing;
                case "dd":
                case "dt":
                  return ancestorInfo.dlItemTagAutoclosing;
                case "button":
                  return ancestorInfo.buttonTagInScope;
                case "a":
                  return ancestorInfo.aTagInScope;
                case "nobr":
                  return ancestorInfo.nobrTagInScope;
              }
              return null;
            };
            var didWarn$1 = {};
            validateDOMNesting = function(childTag, childText, ancestorInfo) {
              ancestorInfo = ancestorInfo || emptyAncestorInfo;
              var parentInfo = ancestorInfo.current;
              var parentTag = parentInfo && parentInfo.tag;
              if (childText != null) {
                if (childTag != null) {
                  error("validateDOMNesting: when childText is passed, childTag should be null");
                }
                childTag = "#text";
              }
              var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
              var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
              var invalidParentOrAncestor = invalidParent || invalidAncestor;
              if (!invalidParentOrAncestor) {
                return;
              }
              var ancestorTag = invalidParentOrAncestor.tag;
              var warnKey = !!invalidParent + "|" + childTag + "|" + ancestorTag;
              if (didWarn$1[warnKey]) {
                return;
              }
              didWarn$1[warnKey] = true;
              var tagDisplayName = childTag;
              var whitespaceInfo = "";
              if (childTag === "#text") {
                if (/\S/.test(childText)) {
                  tagDisplayName = "Text nodes";
                } else {
                  tagDisplayName = "Whitespace text nodes";
                  whitespaceInfo = " Make sure you don't have any extra whitespace between tags on each line of your source code.";
                }
              } else {
                tagDisplayName = "<" + childTag + ">";
              }
              if (invalidParent) {
                var info = "";
                if (ancestorTag === "table" && childTag === "tr") {
                  info += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.";
                }
                error("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s", tagDisplayName, ancestorTag, whitespaceInfo, info);
              } else {
                error("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.", tagDisplayName, ancestorTag);
              }
            };
          }
          var SUPPRESS_HYDRATION_WARNING$1;
          {
            SUPPRESS_HYDRATION_WARNING$1 = "suppressHydrationWarning";
          }
          var SUSPENSE_START_DATA = "$";
          var SUSPENSE_END_DATA = "/$";
          var SUSPENSE_PENDING_START_DATA = "$?";
          var SUSPENSE_FALLBACK_START_DATA = "$!";
          var STYLE$1 = "style";
          var eventsEnabled = null;
          var selectionInformation = null;
          function shouldAutoFocusHostComponent(type, props) {
            switch (type) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                return !!props.autoFocus;
            }
            return false;
          }
          function getRootHostContext(rootContainerInstance) {
            var type;
            var namespace;
            var nodeType = rootContainerInstance.nodeType;
            switch (nodeType) {
              case DOCUMENT_NODE:
              case DOCUMENT_FRAGMENT_NODE: {
                type = nodeType === DOCUMENT_NODE ? "#document" : "#fragment";
                var root2 = rootContainerInstance.documentElement;
                namespace = root2 ? root2.namespaceURI : getChildNamespace(null, "");
                break;
              }
              default: {
                var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
                var ownNamespace = container.namespaceURI || null;
                type = container.tagName;
                namespace = getChildNamespace(ownNamespace, type);
                break;
              }
            }
            {
              var validatedTag = type.toLowerCase();
              var ancestorInfo = updatedAncestorInfo(null, validatedTag);
              return {
                namespace,
                ancestorInfo
              };
            }
          }
          function getChildHostContext(parentHostContext, type, rootContainerInstance) {
            {
              var parentHostContextDev = parentHostContext;
              var namespace = getChildNamespace(parentHostContextDev.namespace, type);
              var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
              return {
                namespace,
                ancestorInfo
              };
            }
          }
          function getPublicInstance(instance) {
            return instance;
          }
          function prepareForCommit(containerInfo) {
            eventsEnabled = isEnabled();
            selectionInformation = getSelectionInformation();
            var activeInstance = null;
            setEnabled(false);
            return activeInstance;
          }
          function resetAfterCommit(containerInfo) {
            restoreSelection(selectionInformation);
            setEnabled(eventsEnabled);
            eventsEnabled = null;
            selectionInformation = null;
          }
          function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
            var parentNamespace;
            {
              var hostContextDev = hostContext;
              validateDOMNesting(type, null, hostContextDev.ancestorInfo);
              if (typeof props.children === "string" || typeof props.children === "number") {
                var string = "" + props.children;
                var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
                validateDOMNesting(null, string, ownAncestorInfo);
              }
              parentNamespace = hostContextDev.namespace;
            }
            var domElement = createElement3(type, props, rootContainerInstance, parentNamespace);
            precacheFiberNode(internalInstanceHandle, domElement);
            updateFiberProps(domElement, props);
            return domElement;
          }
          function appendInitialChild(parentInstance, child) {
            parentInstance.appendChild(child);
          }
          function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
            setInitialProperties(domElement, type, props, rootContainerInstance);
            return shouldAutoFocusHostComponent(type, props);
          }
          function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
            {
              var hostContextDev = hostContext;
              if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === "string" || typeof newProps.children === "number")) {
                var string = "" + newProps.children;
                var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
                validateDOMNesting(null, string, ownAncestorInfo);
              }
            }
            return diffProperties(domElement, type, oldProps, newProps);
          }
          function shouldSetTextContent(type, props) {
            return type === "textarea" || type === "option" || type === "noscript" || typeof props.children === "string" || typeof props.children === "number" || typeof props.dangerouslySetInnerHTML === "object" && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
          }
          function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
            {
              var hostContextDev = hostContext;
              validateDOMNesting(null, text, hostContextDev.ancestorInfo);
            }
            var textNode = createTextNode(text, rootContainerInstance);
            precacheFiberNode(internalInstanceHandle, textNode);
            return textNode;
          }
          var scheduleTimeout = typeof setTimeout === "function" ? setTimeout : void 0;
          var cancelTimeout = typeof clearTimeout === "function" ? clearTimeout : void 0;
          var noTimeout = -1;
          function commitMount(domElement, type, newProps, internalInstanceHandle) {
            if (shouldAutoFocusHostComponent(type, newProps)) {
              domElement.focus();
            }
          }
          function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
            updateFiberProps(domElement, newProps);
            updateProperties(domElement, updatePayload, type, oldProps, newProps);
          }
          function resetTextContent(domElement) {
            setTextContent(domElement, "");
          }
          function commitTextUpdate(textInstance, oldText, newText) {
            textInstance.nodeValue = newText;
          }
          function appendChild(parentInstance, child) {
            parentInstance.appendChild(child);
          }
          function appendChildToContainer(container, child) {
            var parentNode;
            if (container.nodeType === COMMENT_NODE) {
              parentNode = container.parentNode;
              parentNode.insertBefore(child, container);
            } else {
              parentNode = container;
              parentNode.appendChild(child);
            }
            var reactRootContainer = container._reactRootContainer;
            if ((reactRootContainer === null || reactRootContainer === void 0) && parentNode.onclick === null) {
              trapClickOnNonInteractiveElement(parentNode);
            }
          }
          function insertBefore(parentInstance, child, beforeChild) {
            parentInstance.insertBefore(child, beforeChild);
          }
          function insertInContainerBefore(container, child, beforeChild) {
            if (container.nodeType === COMMENT_NODE) {
              container.parentNode.insertBefore(child, beforeChild);
            } else {
              container.insertBefore(child, beforeChild);
            }
          }
          function removeChild(parentInstance, child) {
            parentInstance.removeChild(child);
          }
          function removeChildFromContainer(container, child) {
            if (container.nodeType === COMMENT_NODE) {
              container.parentNode.removeChild(child);
            } else {
              container.removeChild(child);
            }
          }
          function hideInstance(instance) {
            instance = instance;
            var style3 = instance.style;
            if (typeof style3.setProperty === "function") {
              style3.setProperty("display", "none", "important");
            } else {
              style3.display = "none";
            }
          }
          function hideTextInstance(textInstance) {
            textInstance.nodeValue = "";
          }
          function unhideInstance(instance, props) {
            instance = instance;
            var styleProp = props[STYLE$1];
            var display = styleProp !== void 0 && styleProp !== null && styleProp.hasOwnProperty("display") ? styleProp.display : null;
            instance.style.display = dangerousStyleValue("display", display);
          }
          function unhideTextInstance(textInstance, text) {
            textInstance.nodeValue = text;
          }
          function clearContainer(container) {
            if (container.nodeType === ELEMENT_NODE) {
              container.textContent = "";
            } else if (container.nodeType === DOCUMENT_NODE) {
              var body = container.body;
              if (body != null) {
                body.textContent = "";
              }
            }
          }
          function canHydrateInstance(instance, type, props) {
            if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
              return null;
            }
            return instance;
          }
          function canHydrateTextInstance(instance, text) {
            if (text === "" || instance.nodeType !== TEXT_NODE) {
              return null;
            }
            return instance;
          }
          function isSuspenseInstancePending(instance) {
            return instance.data === SUSPENSE_PENDING_START_DATA;
          }
          function isSuspenseInstanceFallback(instance) {
            return instance.data === SUSPENSE_FALLBACK_START_DATA;
          }
          function getNextHydratable(node) {
            for (; node != null; node = node.nextSibling) {
              var nodeType = node.nodeType;
              if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
                break;
              }
            }
            return node;
          }
          function getNextHydratableSibling(instance) {
            return getNextHydratable(instance.nextSibling);
          }
          function getFirstHydratableChild(parentInstance) {
            return getNextHydratable(parentInstance.firstChild);
          }
          function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
            precacheFiberNode(internalInstanceHandle, instance);
            updateFiberProps(instance, props);
            var parentNamespace;
            {
              var hostContextDev = hostContext;
              parentNamespace = hostContextDev.namespace;
            }
            return diffHydratedProperties(instance, type, props, parentNamespace);
          }
          function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
            precacheFiberNode(internalInstanceHandle, textInstance);
            return diffHydratedText(textInstance, text);
          }
          function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
            var node = suspenseInstance.nextSibling;
            var depth = 0;
            while (node) {
              if (node.nodeType === COMMENT_NODE) {
                var data = node.data;
                if (data === SUSPENSE_END_DATA) {
                  if (depth === 0) {
                    return getNextHydratableSibling(node);
                  } else {
                    depth--;
                  }
                } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
                  depth++;
                }
              }
              node = node.nextSibling;
            }
            return null;
          }
          function getParentSuspenseInstance(targetInstance) {
            var node = targetInstance.previousSibling;
            var depth = 0;
            while (node) {
              if (node.nodeType === COMMENT_NODE) {
                var data = node.data;
                if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
                  if (depth === 0) {
                    return node;
                  } else {
                    depth--;
                  }
                } else if (data === SUSPENSE_END_DATA) {
                  depth++;
                }
              }
              node = node.previousSibling;
            }
            return null;
          }
          function commitHydratedContainer(container) {
            retryIfBlockedOn(container);
          }
          function commitHydratedSuspenseInstance(suspenseInstance) {
            retryIfBlockedOn(suspenseInstance);
          }
          function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
            {
              warnForUnmatchedText(textInstance, text);
            }
          }
          function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
            if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
              warnForUnmatchedText(textInstance, text);
            }
          }
          function didNotHydrateContainerInstance(parentContainer, instance) {
            {
              if (instance.nodeType === ELEMENT_NODE) {
                warnForDeletedHydratableElement(parentContainer, instance);
              } else if (instance.nodeType === COMMENT_NODE)
                ;
              else {
                warnForDeletedHydratableText(parentContainer, instance);
              }
            }
          }
          function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
            if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
              if (instance.nodeType === ELEMENT_NODE) {
                warnForDeletedHydratableElement(parentInstance, instance);
              } else if (instance.nodeType === COMMENT_NODE)
                ;
              else {
                warnForDeletedHydratableText(parentInstance, instance);
              }
            }
          }
          function didNotFindHydratableContainerInstance(parentContainer, type, props) {
            {
              warnForInsertedHydratedElement(parentContainer, type);
            }
          }
          function didNotFindHydratableContainerTextInstance(parentContainer, text) {
            {
              warnForInsertedHydratedText(parentContainer, text);
            }
          }
          function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
            if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
              warnForInsertedHydratedElement(parentInstance, type);
            }
          }
          function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
            if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
              warnForInsertedHydratedText(parentInstance, text);
            }
          }
          function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {
            if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true)
              ;
          }
          var clientId = 0;
          function makeClientIdInDEV(warnOnAccessInDEV) {
            var id = "r:" + (clientId++).toString(36);
            return {
              toString: function() {
                warnOnAccessInDEV();
                return id;
              },
              valueOf: function() {
                warnOnAccessInDEV();
                return id;
              }
            };
          }
          function isOpaqueHydratingObject(value) {
            return value !== null && typeof value === "object" && value.$$typeof === REACT_OPAQUE_ID_TYPE;
          }
          function makeOpaqueHydratingObject(attemptToReadValue) {
            return {
              $$typeof: REACT_OPAQUE_ID_TYPE,
              toString: attemptToReadValue,
              valueOf: attemptToReadValue
            };
          }
          function preparePortalMount(portalInstance) {
            {
              listenToAllSupportedEvents(portalInstance);
            }
          }
          var randomKey = Math.random().toString(36).slice(2);
          var internalInstanceKey = "__reactFiber$" + randomKey;
          var internalPropsKey = "__reactProps$" + randomKey;
          var internalContainerInstanceKey = "__reactContainer$" + randomKey;
          var internalEventHandlersKey = "__reactEvents$" + randomKey;
          function precacheFiberNode(hostInst, node) {
            node[internalInstanceKey] = hostInst;
          }
          function markContainerAsRoot(hostRoot, node) {
            node[internalContainerInstanceKey] = hostRoot;
          }
          function unmarkContainerAsRoot(node) {
            node[internalContainerInstanceKey] = null;
          }
          function isContainerMarkedAsRoot(node) {
            return !!node[internalContainerInstanceKey];
          }
          function getClosestInstanceFromNode(targetNode) {
            var targetInst = targetNode[internalInstanceKey];
            if (targetInst) {
              return targetInst;
            }
            var parentNode = targetNode.parentNode;
            while (parentNode) {
              targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];
              if (targetInst) {
                var alternate = targetInst.alternate;
                if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
                  var suspenseInstance = getParentSuspenseInstance(targetNode);
                  while (suspenseInstance !== null) {
                    var targetSuspenseInst = suspenseInstance[internalInstanceKey];
                    if (targetSuspenseInst) {
                      return targetSuspenseInst;
                    }
                    suspenseInstance = getParentSuspenseInstance(suspenseInstance);
                  }
                }
                return targetInst;
              }
              targetNode = parentNode;
              parentNode = targetNode.parentNode;
            }
            return null;
          }
          function getInstanceFromNode(node) {
            var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
            if (inst) {
              if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
                return inst;
              } else {
                return null;
              }
            }
            return null;
          }
          function getNodeFromInstance(inst) {
            if (inst.tag === HostComponent || inst.tag === HostText) {
              return inst.stateNode;
            }
            {
              {
                throw Error("getNodeFromInstance: Invalid argument.");
              }
            }
          }
          function getFiberCurrentPropsFromNode(node) {
            return node[internalPropsKey] || null;
          }
          function updateFiberProps(node, props) {
            node[internalPropsKey] = props;
          }
          function getEventListenerSet(node) {
            var elementListenerSet = node[internalEventHandlersKey];
            if (elementListenerSet === void 0) {
              elementListenerSet = node[internalEventHandlersKey] = /* @__PURE__ */ new Set();
            }
            return elementListenerSet;
          }
          var loggedTypeFailures = {};
          var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
          function setCurrentlyValidatingElement(element) {
            {
              if (element) {
                var owner = element._owner;
                var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
                ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
              } else {
                ReactDebugCurrentFrame$1.setExtraStackFrame(null);
              }
            }
          }
          function checkPropTypes(typeSpecs, values, location, componentName, element) {
            {
              var has2 = Function.call.bind(Object.prototype.hasOwnProperty);
              for (var typeSpecName in typeSpecs) {
                if (has2(typeSpecs, typeSpecName)) {
                  var error$1 = void 0;
                  try {
                    if (typeof typeSpecs[typeSpecName] !== "function") {
                      var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                      err.name = "Invariant Violation";
                      throw err;
                    }
                    error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                  } catch (ex) {
                    error$1 = ex;
                  }
                  if (error$1 && !(error$1 instanceof Error)) {
                    setCurrentlyValidatingElement(element);
                    error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
                    setCurrentlyValidatingElement(null);
                  }
                  if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
                    loggedTypeFailures[error$1.message] = true;
                    setCurrentlyValidatingElement(element);
                    error("Failed %s type: %s", location, error$1.message);
                    setCurrentlyValidatingElement(null);
                  }
                }
              }
            }
          }
          var valueStack = [];
          var fiberStack;
          {
            fiberStack = [];
          }
          var index = -1;
          function createCursor(defaultValue) {
            return {
              current: defaultValue
            };
          }
          function pop(cursor, fiber) {
            if (index < 0) {
              {
                error("Unexpected pop.");
              }
              return;
            }
            {
              if (fiber !== fiberStack[index]) {
                error("Unexpected Fiber popped.");
              }
            }
            cursor.current = valueStack[index];
            valueStack[index] = null;
            {
              fiberStack[index] = null;
            }
            index--;
          }
          function push(cursor, value, fiber) {
            index++;
            valueStack[index] = cursor.current;
            {
              fiberStack[index] = fiber;
            }
            cursor.current = value;
          }
          var warnedAboutMissingGetChildContext;
          {
            warnedAboutMissingGetChildContext = {};
          }
          var emptyContextObject = {};
          {
            Object.freeze(emptyContextObject);
          }
          var contextStackCursor = createCursor(emptyContextObject);
          var didPerformWorkStackCursor = createCursor(false);
          var previousContext = emptyContextObject;
          function getUnmaskedContext(workInProgress2, Component2, didPushOwnContextIfProvider) {
            {
              if (didPushOwnContextIfProvider && isContextProvider(Component2)) {
                return previousContext;
              }
              return contextStackCursor.current;
            }
          }
          function cacheContext(workInProgress2, unmaskedContext, maskedContext) {
            {
              var instance = workInProgress2.stateNode;
              instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
              instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
            }
          }
          function getMaskedContext(workInProgress2, unmaskedContext) {
            {
              var type = workInProgress2.type;
              var contextTypes = type.contextTypes;
              if (!contextTypes) {
                return emptyContextObject;
              }
              var instance = workInProgress2.stateNode;
              if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
                return instance.__reactInternalMemoizedMaskedChildContext;
              }
              var context = {};
              for (var key2 in contextTypes) {
                context[key2] = unmaskedContext[key2];
              }
              {
                var name = getComponentName(type) || "Unknown";
                checkPropTypes(contextTypes, context, "context", name);
              }
              if (instance) {
                cacheContext(workInProgress2, unmaskedContext, context);
              }
              return context;
            }
          }
          function hasContextChanged() {
            {
              return didPerformWorkStackCursor.current;
            }
          }
          function isContextProvider(type) {
            {
              var childContextTypes = type.childContextTypes;
              return childContextTypes !== null && childContextTypes !== void 0;
            }
          }
          function popContext(fiber) {
            {
              pop(didPerformWorkStackCursor, fiber);
              pop(contextStackCursor, fiber);
            }
          }
          function popTopLevelContextObject(fiber) {
            {
              pop(didPerformWorkStackCursor, fiber);
              pop(contextStackCursor, fiber);
            }
          }
          function pushTopLevelContextObject(fiber, context, didChange) {
            {
              if (!(contextStackCursor.current === emptyContextObject)) {
                {
                  throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              push(contextStackCursor, context, fiber);
              push(didPerformWorkStackCursor, didChange, fiber);
            }
          }
          function processChildContext(fiber, type, parentContext) {
            {
              var instance = fiber.stateNode;
              var childContextTypes = type.childContextTypes;
              if (typeof instance.getChildContext !== "function") {
                {
                  var componentName = getComponentName(type) || "Unknown";
                  if (!warnedAboutMissingGetChildContext[componentName]) {
                    warnedAboutMissingGetChildContext[componentName] = true;
                    error("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", componentName, componentName);
                  }
                }
                return parentContext;
              }
              var childContext = instance.getChildContext();
              for (var contextKey in childContext) {
                if (!(contextKey in childContextTypes)) {
                  {
                    throw Error((getComponentName(type) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.');
                  }
                }
              }
              {
                var name = getComponentName(type) || "Unknown";
                checkPropTypes(childContextTypes, childContext, "child context", name);
              }
              return _assign({}, parentContext, childContext);
            }
          }
          function pushContextProvider(workInProgress2) {
            {
              var instance = workInProgress2.stateNode;
              var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject;
              previousContext = contextStackCursor.current;
              push(contextStackCursor, memoizedMergedChildContext, workInProgress2);
              push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress2);
              return true;
            }
          }
          function invalidateContextProvider(workInProgress2, type, didChange) {
            {
              var instance = workInProgress2.stateNode;
              if (!instance) {
                {
                  throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              if (didChange) {
                var mergedContext = processChildContext(workInProgress2, type, previousContext);
                instance.__reactInternalMemoizedMergedChildContext = mergedContext;
                pop(didPerformWorkStackCursor, workInProgress2);
                pop(contextStackCursor, workInProgress2);
                push(contextStackCursor, mergedContext, workInProgress2);
                push(didPerformWorkStackCursor, didChange, workInProgress2);
              } else {
                pop(didPerformWorkStackCursor, workInProgress2);
                push(didPerformWorkStackCursor, didChange, workInProgress2);
              }
            }
          }
          function findCurrentUnmaskedContext(fiber) {
            {
              if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {
                {
                  throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              var node = fiber;
              do {
                switch (node.tag) {
                  case HostRoot:
                    return node.stateNode.context;
                  case ClassComponent: {
                    var Component2 = node.type;
                    if (isContextProvider(Component2)) {
                      return node.stateNode.__reactInternalMemoizedMergedChildContext;
                    }
                    break;
                  }
                }
                node = node.return;
              } while (node !== null);
              {
                {
                  throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
            }
          }
          var LegacyRoot = 0;
          var BlockingRoot = 1;
          var ConcurrentRoot = 2;
          var rendererID = null;
          var injectedHook = null;
          var hasLoggedError = false;
          var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined";
          function injectInternals(internals) {
            if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") {
              return false;
            }
            var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
            if (hook.isDisabled) {
              return true;
            }
            if (!hook.supportsFiber) {
              {
                error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools");
              }
              return true;
            }
            try {
              rendererID = hook.inject(internals);
              injectedHook = hook;
            } catch (err) {
              {
                error("React instrumentation encountered an error: %s.", err);
              }
            }
            return true;
          }
          function onScheduleRoot(root2, children) {
            {
              if (injectedHook && typeof injectedHook.onScheduleFiberRoot === "function") {
                try {
                  injectedHook.onScheduleFiberRoot(rendererID, root2, children);
                } catch (err) {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          function onCommitRoot(root2, priorityLevel) {
            if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") {
              try {
                var didError = (root2.current.flags & DidCapture) === DidCapture;
                if (enableProfilerTimer) {
                  injectedHook.onCommitFiberRoot(rendererID, root2, priorityLevel, didError);
                } else {
                  injectedHook.onCommitFiberRoot(rendererID, root2, void 0, didError);
                }
              } catch (err) {
                {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          function onCommitUnmount(fiber) {
            if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") {
              try {
                injectedHook.onCommitFiberUnmount(rendererID, fiber);
              } catch (err) {
                {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority, Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback, Scheduler_cancelCallback = Scheduler.unstable_cancelCallback, Scheduler_shouldYield = Scheduler.unstable_shouldYield, Scheduler_requestPaint = Scheduler.unstable_requestPaint, Scheduler_now$1 = Scheduler.unstable_now, Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel, Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority, Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, Scheduler_NormalPriority = Scheduler.unstable_NormalPriority, Scheduler_LowPriority = Scheduler.unstable_LowPriority, Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;
          {
            if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
              {
                throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");
              }
            }
          }
          var fakeCallbackNode = {};
          var ImmediatePriority$1 = 99;
          var UserBlockingPriority$2 = 98;
          var NormalPriority$1 = 97;
          var LowPriority$1 = 96;
          var IdlePriority$1 = 95;
          var NoPriority$1 = 90;
          var shouldYield = Scheduler_shouldYield;
          var requestPaint = Scheduler_requestPaint !== void 0 ? Scheduler_requestPaint : function() {
          };
          var syncQueue = null;
          var immediateQueueCallbackNode = null;
          var isFlushingSyncQueue = false;
          var initialTimeMs$1 = Scheduler_now$1();
          var now = initialTimeMs$1 < 1e4 ? Scheduler_now$1 : function() {
            return Scheduler_now$1() - initialTimeMs$1;
          };
          function getCurrentPriorityLevel() {
            switch (Scheduler_getCurrentPriorityLevel()) {
              case Scheduler_ImmediatePriority:
                return ImmediatePriority$1;
              case Scheduler_UserBlockingPriority:
                return UserBlockingPriority$2;
              case Scheduler_NormalPriority:
                return NormalPriority$1;
              case Scheduler_LowPriority:
                return LowPriority$1;
              case Scheduler_IdlePriority:
                return IdlePriority$1;
              default: {
                {
                  throw Error("Unknown priority level.");
                }
              }
            }
          }
          function reactPriorityToSchedulerPriority(reactPriorityLevel) {
            switch (reactPriorityLevel) {
              case ImmediatePriority$1:
                return Scheduler_ImmediatePriority;
              case UserBlockingPriority$2:
                return Scheduler_UserBlockingPriority;
              case NormalPriority$1:
                return Scheduler_NormalPriority;
              case LowPriority$1:
                return Scheduler_LowPriority;
              case IdlePriority$1:
                return Scheduler_IdlePriority;
              default: {
                {
                  throw Error("Unknown priority level.");
                }
              }
            }
          }
          function runWithPriority$1(reactPriorityLevel, fn) {
            var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
            return Scheduler_runWithPriority(priorityLevel, fn);
          }
          function scheduleCallback(reactPriorityLevel, callback, options2) {
            var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
            return Scheduler_scheduleCallback(priorityLevel, callback, options2);
          }
          function scheduleSyncCallback(callback) {
            if (syncQueue === null) {
              syncQueue = [callback];
              immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);
            } else {
              syncQueue.push(callback);
            }
            return fakeCallbackNode;
          }
          function cancelCallback(callbackNode) {
            if (callbackNode !== fakeCallbackNode) {
              Scheduler_cancelCallback(callbackNode);
            }
          }
          function flushSyncCallbackQueue() {
            if (immediateQueueCallbackNode !== null) {
              var node = immediateQueueCallbackNode;
              immediateQueueCallbackNode = null;
              Scheduler_cancelCallback(node);
            }
            flushSyncCallbackQueueImpl();
          }
          function flushSyncCallbackQueueImpl() {
            if (!isFlushingSyncQueue && syncQueue !== null) {
              isFlushingSyncQueue = true;
              var i = 0;
              {
                try {
                  var _isSync2 = true;
                  var _queue = syncQueue;
                  runWithPriority$1(ImmediatePriority$1, function() {
                    for (; i < _queue.length; i++) {
                      var callback = _queue[i];
                      do {
                        callback = callback(_isSync2);
                      } while (callback !== null);
                    }
                  });
                  syncQueue = null;
                } catch (error2) {
                  if (syncQueue !== null) {
                    syncQueue = syncQueue.slice(i + 1);
                  }
                  Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);
                  throw error2;
                } finally {
                  isFlushingSyncQueue = false;
                }
              }
            }
          }
          var ReactVersion = "17.0.2";
          var NoMode = 0;
          var StrictMode = 1;
          var BlockingMode = 2;
          var ConcurrentMode = 4;
          var ProfileMode = 8;
          var DebugTracingMode = 16;
          var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
          var NoTransition = 0;
          function requestCurrentTransition() {
            return ReactCurrentBatchConfig.transition;
          }
          var ReactStrictModeWarnings = {
            recordUnsafeLifecycleWarnings: function(fiber, instance) {
            },
            flushPendingUnsafeLifecycleWarnings: function() {
            },
            recordLegacyContextWarning: function(fiber, instance) {
            },
            flushLegacyContextWarning: function() {
            },
            discardPendingWarnings: function() {
            }
          };
          {
            var findStrictRoot = function(fiber) {
              var maybeStrictRoot = null;
              var node = fiber;
              while (node !== null) {
                if (node.mode & StrictMode) {
                  maybeStrictRoot = node;
                }
                node = node.return;
              }
              return maybeStrictRoot;
            };
            var setToSortedString = function(set2) {
              var array = [];
              set2.forEach(function(value) {
                array.push(value);
              });
              return array.sort().join(", ");
            };
            var pendingComponentWillMountWarnings = [];
            var pendingUNSAFE_ComponentWillMountWarnings = [];
            var pendingComponentWillReceivePropsWarnings = [];
            var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
            var pendingComponentWillUpdateWarnings = [];
            var pendingUNSAFE_ComponentWillUpdateWarnings = [];
            var didWarnAboutUnsafeLifecycles = /* @__PURE__ */ new Set();
            ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function(fiber, instance) {
              if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
                return;
              }
              if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) {
                pendingComponentWillMountWarnings.push(fiber);
              }
              if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === "function") {
                pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
              }
              if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
                pendingComponentWillReceivePropsWarnings.push(fiber);
              }
              if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") {
                pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
              }
              if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
                pendingComponentWillUpdateWarnings.push(fiber);
              }
              if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === "function") {
                pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
              }
            };
            ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function() {
              var componentWillMountUniqueNames = /* @__PURE__ */ new Set();
              if (pendingComponentWillMountWarnings.length > 0) {
                pendingComponentWillMountWarnings.forEach(function(fiber) {
                  componentWillMountUniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingComponentWillMountWarnings = [];
              }
              var UNSAFE_componentWillMountUniqueNames = /* @__PURE__ */ new Set();
              if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
                pendingUNSAFE_ComponentWillMountWarnings.forEach(function(fiber) {
                  UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingUNSAFE_ComponentWillMountWarnings = [];
              }
              var componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
              if (pendingComponentWillReceivePropsWarnings.length > 0) {
                pendingComponentWillReceivePropsWarnings.forEach(function(fiber) {
                  componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingComponentWillReceivePropsWarnings = [];
              }
              var UNSAFE_componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
              if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
                pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function(fiber) {
                  UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
              }
              var componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
              if (pendingComponentWillUpdateWarnings.length > 0) {
                pendingComponentWillUpdateWarnings.forEach(function(fiber) {
                  componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingComponentWillUpdateWarnings = [];
              }
              var UNSAFE_componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
              if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
                pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function(fiber) {
                  UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingUNSAFE_ComponentWillUpdateWarnings = [];
              }
              if (UNSAFE_componentWillMountUniqueNames.size > 0) {
                var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
                error("Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n\nPlease update the following components: %s", sortedNames);
              }
              if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
                var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
                error("Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n\nPlease update the following components: %s", _sortedNames);
              }
              if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
                var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
                error("Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n\nPlease update the following components: %s", _sortedNames2);
              }
              if (componentWillMountUniqueNames.size > 0) {
                var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);
                warn("componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames3);
              }
              if (componentWillReceivePropsUniqueNames.size > 0) {
                var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);
                warn("componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames4);
              }
              if (componentWillUpdateUniqueNames.size > 0) {
                var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);
                warn("componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames5);
              }
            };
            var pendingLegacyContextWarning = /* @__PURE__ */ new Map();
            var didWarnAboutLegacyContext = /* @__PURE__ */ new Set();
            ReactStrictModeWarnings.recordLegacyContextWarning = function(fiber, instance) {
              var strictRoot = findStrictRoot(fiber);
              if (strictRoot === null) {
                error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");
                return;
              }
              if (didWarnAboutLegacyContext.has(fiber.type)) {
                return;
              }
              var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
              if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === "function") {
                if (warningsForRoot === void 0) {
                  warningsForRoot = [];
                  pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
                }
                warningsForRoot.push(fiber);
              }
            };
            ReactStrictModeWarnings.flushLegacyContextWarning = function() {
              pendingLegacyContextWarning.forEach(function(fiberArray, strictRoot) {
                if (fiberArray.length === 0) {
                  return;
                }
                var firstFiber = fiberArray[0];
                var uniqueNames = /* @__PURE__ */ new Set();
                fiberArray.forEach(function(fiber) {
                  uniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutLegacyContext.add(fiber.type);
                });
                var sortedNames = setToSortedString(uniqueNames);
                try {
                  setCurrentFiber(firstFiber);
                  error("Legacy context API has been detected within a strict-mode tree.\n\nThe old API will be supported in all 16.x releases, but applications using it should migrate to the new version.\n\nPlease update the following components: %s\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context", sortedNames);
                } finally {
                  resetCurrentFiber();
                }
              });
            };
            ReactStrictModeWarnings.discardPendingWarnings = function() {
              pendingComponentWillMountWarnings = [];
              pendingUNSAFE_ComponentWillMountWarnings = [];
              pendingComponentWillReceivePropsWarnings = [];
              pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
              pendingComponentWillUpdateWarnings = [];
              pendingUNSAFE_ComponentWillUpdateWarnings = [];
              pendingLegacyContextWarning = /* @__PURE__ */ new Map();
            };
          }
          function resolveDefaultProps(Component2, baseProps) {
            if (Component2 && Component2.defaultProps) {
              var props = _assign({}, baseProps);
              var defaultProps = Component2.defaultProps;
              for (var propName in defaultProps) {
                if (props[propName] === void 0) {
                  props[propName] = defaultProps[propName];
                }
              }
              return props;
            }
            return baseProps;
          }
          var MAX_SIGNED_31_BIT_INT = 1073741823;
          var valueCursor = createCursor(null);
          var rendererSigil;
          {
            rendererSigil = {};
          }
          var currentlyRenderingFiber = null;
          var lastContextDependency = null;
          var lastContextWithAllBitsObserved = null;
          var isDisallowedContextReadInDEV = false;
          function resetContextDependencies() {
            currentlyRenderingFiber = null;
            lastContextDependency = null;
            lastContextWithAllBitsObserved = null;
            {
              isDisallowedContextReadInDEV = false;
            }
          }
          function enterDisallowedContextReadInDEV() {
            {
              isDisallowedContextReadInDEV = true;
            }
          }
          function exitDisallowedContextReadInDEV() {
            {
              isDisallowedContextReadInDEV = false;
            }
          }
          function pushProvider(providerFiber, nextValue) {
            var context = providerFiber.type._context;
            {
              push(valueCursor, context._currentValue, providerFiber);
              context._currentValue = nextValue;
              {
                if (context._currentRenderer !== void 0 && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
                  error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");
                }
                context._currentRenderer = rendererSigil;
              }
            }
          }
          function popProvider(providerFiber) {
            var currentValue = valueCursor.current;
            pop(valueCursor, providerFiber);
            var context = providerFiber.type._context;
            {
              context._currentValue = currentValue;
            }
          }
          function calculateChangedBits(context, newValue, oldValue) {
            if (objectIs(oldValue, newValue)) {
              return 0;
            } else {
              var changedBits = typeof context._calculateChangedBits === "function" ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
              {
                if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) {
                  error("calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s", changedBits);
                }
              }
              return changedBits | 0;
            }
          }
          function scheduleWorkOnParentPath(parent, renderLanes2) {
            var node = parent;
            while (node !== null) {
              var alternate = node.alternate;
              if (!isSubsetOfLanes(node.childLanes, renderLanes2)) {
                node.childLanes = mergeLanes(node.childLanes, renderLanes2);
                if (alternate !== null) {
                  alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
                }
              } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes2)) {
                alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
              } else {
                break;
              }
              node = node.return;
            }
          }
          function propagateContextChange(workInProgress2, context, changedBits, renderLanes2) {
            var fiber = workInProgress2.child;
            if (fiber !== null) {
              fiber.return = workInProgress2;
            }
            while (fiber !== null) {
              var nextFiber = void 0;
              var list = fiber.dependencies;
              if (list !== null) {
                nextFiber = fiber.child;
                var dependency = list.firstContext;
                while (dependency !== null) {
                  if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {
                    if (fiber.tag === ClassComponent) {
                      var update = createUpdate(NoTimestamp, pickArbitraryLane(renderLanes2));
                      update.tag = ForceUpdate;
                      enqueueUpdate(fiber, update);
                    }
                    fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
                    var alternate = fiber.alternate;
                    if (alternate !== null) {
                      alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
                    }
                    scheduleWorkOnParentPath(fiber.return, renderLanes2);
                    list.lanes = mergeLanes(list.lanes, renderLanes2);
                    break;
                  }
                  dependency = dependency.next;
                }
              } else if (fiber.tag === ContextProvider) {
                nextFiber = fiber.type === workInProgress2.type ? null : fiber.child;
              } else {
                nextFiber = fiber.child;
              }
              if (nextFiber !== null) {
                nextFiber.return = fiber;
              } else {
                nextFiber = fiber;
                while (nextFiber !== null) {
                  if (nextFiber === workInProgress2) {
                    nextFiber = null;
                    break;
                  }
                  var sibling = nextFiber.sibling;
                  if (sibling !== null) {
                    sibling.return = nextFiber.return;
                    nextFiber = sibling;
                    break;
                  }
                  nextFiber = nextFiber.return;
                }
              }
              fiber = nextFiber;
            }
          }
          function prepareToReadContext(workInProgress2, renderLanes2) {
            currentlyRenderingFiber = workInProgress2;
            lastContextDependency = null;
            lastContextWithAllBitsObserved = null;
            var dependencies = workInProgress2.dependencies;
            if (dependencies !== null) {
              var firstContext = dependencies.firstContext;
              if (firstContext !== null) {
                if (includesSomeLane(dependencies.lanes, renderLanes2)) {
                  markWorkInProgressReceivedUpdate();
                }
                dependencies.firstContext = null;
              }
            }
          }
          function readContext(context, observedBits) {
            {
              if (isDisallowedContextReadInDEV) {
                error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
              }
            }
            if (lastContextWithAllBitsObserved === context)
              ;
            else if (observedBits === false || observedBits === 0)
              ;
            else {
              var resolvedObservedBits;
              if (typeof observedBits !== "number" || observedBits === MAX_SIGNED_31_BIT_INT) {
                lastContextWithAllBitsObserved = context;
                resolvedObservedBits = MAX_SIGNED_31_BIT_INT;
              } else {
                resolvedObservedBits = observedBits;
              }
              var contextItem = {
                context,
                observedBits: resolvedObservedBits,
                next: null
              };
              if (lastContextDependency === null) {
                if (!(currentlyRenderingFiber !== null)) {
                  {
                    throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
                  }
                }
                lastContextDependency = contextItem;
                currentlyRenderingFiber.dependencies = {
                  lanes: NoLanes,
                  firstContext: contextItem,
                  responders: null
                };
              } else {
                lastContextDependency = lastContextDependency.next = contextItem;
              }
            }
            return context._currentValue;
          }
          var UpdateState = 0;
          var ReplaceState = 1;
          var ForceUpdate = 2;
          var CaptureUpdate = 3;
          var hasForceUpdate = false;
          var didWarnUpdateInsideUpdate;
          var currentlyProcessingQueue;
          {
            didWarnUpdateInsideUpdate = false;
            currentlyProcessingQueue = null;
          }
          function initializeUpdateQueue(fiber) {
            var queue = {
              baseState: fiber.memoizedState,
              firstBaseUpdate: null,
              lastBaseUpdate: null,
              shared: {
                pending: null
              },
              effects: null
            };
            fiber.updateQueue = queue;
          }
          function cloneUpdateQueue(current2, workInProgress2) {
            var queue = workInProgress2.updateQueue;
            var currentQueue = current2.updateQueue;
            if (queue === currentQueue) {
              var clone = {
                baseState: currentQueue.baseState,
                firstBaseUpdate: currentQueue.firstBaseUpdate,
                lastBaseUpdate: currentQueue.lastBaseUpdate,
                shared: currentQueue.shared,
                effects: currentQueue.effects
              };
              workInProgress2.updateQueue = clone;
            }
          }
          function createUpdate(eventTime, lane) {
            var update = {
              eventTime,
              lane,
              tag: UpdateState,
              payload: null,
              callback: null,
              next: null
            };
            return update;
          }
          function enqueueUpdate(fiber, update) {
            var updateQueue = fiber.updateQueue;
            if (updateQueue === null) {
              return;
            }
            var sharedQueue = updateQueue.shared;
            var pending = sharedQueue.pending;
            if (pending === null) {
              update.next = update;
            } else {
              update.next = pending.next;
              pending.next = update;
            }
            sharedQueue.pending = update;
            {
              if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
                error("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.");
                didWarnUpdateInsideUpdate = true;
              }
            }
          }
          function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
            var queue = workInProgress2.updateQueue;
            var current2 = workInProgress2.alternate;
            if (current2 !== null) {
              var currentQueue = current2.updateQueue;
              if (queue === currentQueue) {
                var newFirst = null;
                var newLast = null;
                var firstBaseUpdate = queue.firstBaseUpdate;
                if (firstBaseUpdate !== null) {
                  var update = firstBaseUpdate;
                  do {
                    var clone = {
                      eventTime: update.eventTime,
                      lane: update.lane,
                      tag: update.tag,
                      payload: update.payload,
                      callback: update.callback,
                      next: null
                    };
                    if (newLast === null) {
                      newFirst = newLast = clone;
                    } else {
                      newLast.next = clone;
                      newLast = clone;
                    }
                    update = update.next;
                  } while (update !== null);
                  if (newLast === null) {
                    newFirst = newLast = capturedUpdate;
                  } else {
                    newLast.next = capturedUpdate;
                    newLast = capturedUpdate;
                  }
                } else {
                  newFirst = newLast = capturedUpdate;
                }
                queue = {
                  baseState: currentQueue.baseState,
                  firstBaseUpdate: newFirst,
                  lastBaseUpdate: newLast,
                  shared: currentQueue.shared,
                  effects: currentQueue.effects
                };
                workInProgress2.updateQueue = queue;
                return;
              }
            }
            var lastBaseUpdate = queue.lastBaseUpdate;
            if (lastBaseUpdate === null) {
              queue.firstBaseUpdate = capturedUpdate;
            } else {
              lastBaseUpdate.next = capturedUpdate;
            }
            queue.lastBaseUpdate = capturedUpdate;
          }
          function getStateFromUpdate(workInProgress2, queue, update, prevState, nextProps, instance) {
            switch (update.tag) {
              case ReplaceState: {
                var payload = update.payload;
                if (typeof payload === "function") {
                  {
                    enterDisallowedContextReadInDEV();
                  }
                  var nextState = payload.call(instance, prevState, nextProps);
                  {
                    if (workInProgress2.mode & StrictMode) {
                      disableLogs();
                      try {
                        payload.call(instance, prevState, nextProps);
                      } finally {
                        reenableLogs();
                      }
                    }
                    exitDisallowedContextReadInDEV();
                  }
                  return nextState;
                }
                return payload;
              }
              case CaptureUpdate: {
                workInProgress2.flags = workInProgress2.flags & ~ShouldCapture | DidCapture;
              }
              case UpdateState: {
                var _payload = update.payload;
                var partialState;
                if (typeof _payload === "function") {
                  {
                    enterDisallowedContextReadInDEV();
                  }
                  partialState = _payload.call(instance, prevState, nextProps);
                  {
                    if (workInProgress2.mode & StrictMode) {
                      disableLogs();
                      try {
                        _payload.call(instance, prevState, nextProps);
                      } finally {
                        reenableLogs();
                      }
                    }
                    exitDisallowedContextReadInDEV();
                  }
                } else {
                  partialState = _payload;
                }
                if (partialState === null || partialState === void 0) {
                  return prevState;
                }
                return _assign({}, prevState, partialState);
              }
              case ForceUpdate: {
                hasForceUpdate = true;
                return prevState;
              }
            }
            return prevState;
          }
          function processUpdateQueue(workInProgress2, props, instance, renderLanes2) {
            var queue = workInProgress2.updateQueue;
            hasForceUpdate = false;
            {
              currentlyProcessingQueue = queue.shared;
            }
            var firstBaseUpdate = queue.firstBaseUpdate;
            var lastBaseUpdate = queue.lastBaseUpdate;
            var pendingQueue = queue.shared.pending;
            if (pendingQueue !== null) {
              queue.shared.pending = null;
              var lastPendingUpdate = pendingQueue;
              var firstPendingUpdate = lastPendingUpdate.next;
              lastPendingUpdate.next = null;
              if (lastBaseUpdate === null) {
                firstBaseUpdate = firstPendingUpdate;
              } else {
                lastBaseUpdate.next = firstPendingUpdate;
              }
              lastBaseUpdate = lastPendingUpdate;
              var current2 = workInProgress2.alternate;
              if (current2 !== null) {
                var currentQueue = current2.updateQueue;
                var currentLastBaseUpdate = currentQueue.lastBaseUpdate;
                if (currentLastBaseUpdate !== lastBaseUpdate) {
                  if (currentLastBaseUpdate === null) {
                    currentQueue.firstBaseUpdate = firstPendingUpdate;
                  } else {
                    currentLastBaseUpdate.next = firstPendingUpdate;
                  }
                  currentQueue.lastBaseUpdate = lastPendingUpdate;
                }
              }
            }
            if (firstBaseUpdate !== null) {
              var newState = queue.baseState;
              var newLanes = NoLanes;
              var newBaseState = null;
              var newFirstBaseUpdate = null;
              var newLastBaseUpdate = null;
              var update = firstBaseUpdate;
              do {
                var updateLane = update.lane;
                var updateEventTime = update.eventTime;
                if (!isSubsetOfLanes(renderLanes2, updateLane)) {
                  var clone = {
                    eventTime: updateEventTime,
                    lane: updateLane,
                    tag: update.tag,
                    payload: update.payload,
                    callback: update.callback,
                    next: null
                  };
                  if (newLastBaseUpdate === null) {
                    newFirstBaseUpdate = newLastBaseUpdate = clone;
                    newBaseState = newState;
                  } else {
                    newLastBaseUpdate = newLastBaseUpdate.next = clone;
                  }
                  newLanes = mergeLanes(newLanes, updateLane);
                } else {
                  if (newLastBaseUpdate !== null) {
                    var _clone = {
                      eventTime: updateEventTime,
                      lane: NoLane,
                      tag: update.tag,
                      payload: update.payload,
                      callback: update.callback,
                      next: null
                    };
                    newLastBaseUpdate = newLastBaseUpdate.next = _clone;
                  }
                  newState = getStateFromUpdate(workInProgress2, queue, update, newState, props, instance);
                  var callback = update.callback;
                  if (callback !== null) {
                    workInProgress2.flags |= Callback;
                    var effects = queue.effects;
                    if (effects === null) {
                      queue.effects = [update];
                    } else {
                      effects.push(update);
                    }
                  }
                }
                update = update.next;
                if (update === null) {
                  pendingQueue = queue.shared.pending;
                  if (pendingQueue === null) {
                    break;
                  } else {
                    var _lastPendingUpdate = pendingQueue;
                    var _firstPendingUpdate = _lastPendingUpdate.next;
                    _lastPendingUpdate.next = null;
                    update = _firstPendingUpdate;
                    queue.lastBaseUpdate = _lastPendingUpdate;
                    queue.shared.pending = null;
                  }
                }
              } while (true);
              if (newLastBaseUpdate === null) {
                newBaseState = newState;
              }
              queue.baseState = newBaseState;
              queue.firstBaseUpdate = newFirstBaseUpdate;
              queue.lastBaseUpdate = newLastBaseUpdate;
              markSkippedUpdateLanes(newLanes);
              workInProgress2.lanes = newLanes;
              workInProgress2.memoizedState = newState;
            }
            {
              currentlyProcessingQueue = null;
            }
          }
          function callCallback(callback, context) {
            if (!(typeof callback === "function")) {
              {
                throw Error("Invalid argument passed as callback. Expected a function. Instead received: " + callback);
              }
            }
            callback.call(context);
          }
          function resetHasForceUpdateBeforeProcessing() {
            hasForceUpdate = false;
          }
          function checkHasForceUpdateAfterProcessing() {
            return hasForceUpdate;
          }
          function commitUpdateQueue(finishedWork, finishedQueue, instance) {
            var effects = finishedQueue.effects;
            finishedQueue.effects = null;
            if (effects !== null) {
              for (var i = 0; i < effects.length; i++) {
                var effect = effects[i];
                var callback = effect.callback;
                if (callback !== null) {
                  effect.callback = null;
                  callCallback(callback, instance);
                }
              }
            }
          }
          var fakeInternalInstance = {};
          var isArray = Array.isArray;
          var emptyRefsObject = new React215.Component().refs;
          var didWarnAboutStateAssignmentForComponent;
          var didWarnAboutUninitializedState;
          var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
          var didWarnAboutLegacyLifecyclesAndDerivedState;
          var didWarnAboutUndefinedDerivedState;
          var warnOnUndefinedDerivedState;
          var warnOnInvalidCallback;
          var didWarnAboutDirectlyAssigningPropsToState;
          var didWarnAboutContextTypeAndContextTypes;
          var didWarnAboutInvalidateContextType;
          {
            didWarnAboutStateAssignmentForComponent = /* @__PURE__ */ new Set();
            didWarnAboutUninitializedState = /* @__PURE__ */ new Set();
            didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = /* @__PURE__ */ new Set();
            didWarnAboutLegacyLifecyclesAndDerivedState = /* @__PURE__ */ new Set();
            didWarnAboutDirectlyAssigningPropsToState = /* @__PURE__ */ new Set();
            didWarnAboutUndefinedDerivedState = /* @__PURE__ */ new Set();
            didWarnAboutContextTypeAndContextTypes = /* @__PURE__ */ new Set();
            didWarnAboutInvalidateContextType = /* @__PURE__ */ new Set();
            var didWarnOnInvalidCallback = /* @__PURE__ */ new Set();
            warnOnInvalidCallback = function(callback, callerName) {
              if (callback === null || typeof callback === "function") {
                return;
              }
              var key2 = callerName + "_" + callback;
              if (!didWarnOnInvalidCallback.has(key2)) {
                didWarnOnInvalidCallback.add(key2);
                error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
              }
            };
            warnOnUndefinedDerivedState = function(type, partialState) {
              if (partialState === void 0) {
                var componentName = getComponentName(type) || "Component";
                if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
                  didWarnAboutUndefinedDerivedState.add(componentName);
                  error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", componentName);
                }
              }
            };
            Object.defineProperty(fakeInternalInstance, "_processChildContext", {
              enumerable: false,
              value: function() {
                {
                  {
                    throw Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
                  }
                }
              }
            });
            Object.freeze(fakeInternalInstance);
          }
          function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
            var prevState = workInProgress2.memoizedState;
            {
              if (workInProgress2.mode & StrictMode) {
                disableLogs();
                try {
                  getDerivedStateFromProps(nextProps, prevState);
                } finally {
                  reenableLogs();
                }
              }
            }
            var partialState = getDerivedStateFromProps(nextProps, prevState);
            {
              warnOnUndefinedDerivedState(ctor, partialState);
            }
            var memoizedState = partialState === null || partialState === void 0 ? prevState : _assign({}, prevState, partialState);
            workInProgress2.memoizedState = memoizedState;
            if (workInProgress2.lanes === NoLanes) {
              var updateQueue = workInProgress2.updateQueue;
              updateQueue.baseState = memoizedState;
            }
          }
          var classComponentUpdater = {
            isMounted,
            enqueueSetState: function(inst, payload, callback) {
              var fiber = get(inst);
              var eventTime = requestEventTime();
              var lane = requestUpdateLane(fiber);
              var update = createUpdate(eventTime, lane);
              update.payload = payload;
              if (callback !== void 0 && callback !== null) {
                {
                  warnOnInvalidCallback(callback, "setState");
                }
                update.callback = callback;
              }
              enqueueUpdate(fiber, update);
              scheduleUpdateOnFiber(fiber, lane, eventTime);
            },
            enqueueReplaceState: function(inst, payload, callback) {
              var fiber = get(inst);
              var eventTime = requestEventTime();
              var lane = requestUpdateLane(fiber);
              var update = createUpdate(eventTime, lane);
              update.tag = ReplaceState;
              update.payload = payload;
              if (callback !== void 0 && callback !== null) {
                {
                  warnOnInvalidCallback(callback, "replaceState");
                }
                update.callback = callback;
              }
              enqueueUpdate(fiber, update);
              scheduleUpdateOnFiber(fiber, lane, eventTime);
            },
            enqueueForceUpdate: function(inst, callback) {
              var fiber = get(inst);
              var eventTime = requestEventTime();
              var lane = requestUpdateLane(fiber);
              var update = createUpdate(eventTime, lane);
              update.tag = ForceUpdate;
              if (callback !== void 0 && callback !== null) {
                {
                  warnOnInvalidCallback(callback, "forceUpdate");
                }
                update.callback = callback;
              }
              enqueueUpdate(fiber, update);
              scheduleUpdateOnFiber(fiber, lane, eventTime);
            }
          };
          function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
            var instance = workInProgress2.stateNode;
            if (typeof instance.shouldComponentUpdate === "function") {
              {
                if (workInProgress2.mode & StrictMode) {
                  disableLogs();
                  try {
                    instance.shouldComponentUpdate(newProps, newState, nextContext);
                  } finally {
                    reenableLogs();
                  }
                }
              }
              var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
              {
                if (shouldUpdate === void 0) {
                  error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", getComponentName(ctor) || "Component");
                }
              }
              return shouldUpdate;
            }
            if (ctor.prototype && ctor.prototype.isPureReactComponent) {
              return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
            }
            return true;
          }
          function checkClassInstance(workInProgress2, ctor, newProps) {
            var instance = workInProgress2.stateNode;
            {
              var name = getComponentName(ctor) || "Component";
              var renderPresent = instance.render;
              if (!renderPresent) {
                if (ctor.prototype && typeof ctor.prototype.render === "function") {
                  error("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", name);
                } else {
                  error("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", name);
                }
              }
              if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {
                error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", name);
              }
              if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {
                error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", name);
              }
              if (instance.propTypes) {
                error("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", name);
              }
              if (instance.contextType) {
                error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", name);
              }
              {
                if (instance.contextTypes) {
                  error("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", name);
                }
                if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
                  didWarnAboutContextTypeAndContextTypes.add(ctor);
                  error("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", name);
                }
              }
              if (typeof instance.componentShouldUpdate === "function") {
                error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", name);
              }
              if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== "undefined") {
                error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", getComponentName(ctor) || "A pure component");
              }
              if (typeof instance.componentDidUnmount === "function") {
                error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", name);
              }
              if (typeof instance.componentDidReceiveProps === "function") {
                error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", name);
              }
              if (typeof instance.componentWillRecieveProps === "function") {
                error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name);
              }
              if (typeof instance.UNSAFE_componentWillRecieveProps === "function") {
                error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name);
              }
              var hasMutatedProps = instance.props !== newProps;
              if (instance.props !== void 0 && hasMutatedProps) {
                error("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", name, name);
              }
              if (instance.defaultProps) {
                error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", name, name);
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function" && typeof instance.componentDidUpdate !== "function" && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
                didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
                error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", getComponentName(ctor));
              }
              if (typeof instance.getDerivedStateFromProps === "function") {
                error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name);
              }
              if (typeof instance.getDerivedStateFromError === "function") {
                error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name);
              }
              if (typeof ctor.getSnapshotBeforeUpdate === "function") {
                error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", name);
              }
              var _state = instance.state;
              if (_state && (typeof _state !== "object" || isArray(_state))) {
                error("%s.state: must be set to an object or null", name);
              }
              if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") {
                error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", name);
              }
            }
          }
          function adoptClassInstance(workInProgress2, instance) {
            instance.updater = classComponentUpdater;
            workInProgress2.stateNode = instance;
            set(instance, workInProgress2);
            {
              instance._reactInternalInstance = fakeInternalInstance;
            }
          }
          function constructClassInstance(workInProgress2, ctor, props) {
            var isLegacyContextConsumer = false;
            var unmaskedContext = emptyContextObject;
            var context = emptyContextObject;
            var contextType = ctor.contextType;
            {
              if ("contextType" in ctor) {
                var isValid = contextType === null || contextType !== void 0 && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === void 0;
                if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
                  didWarnAboutInvalidateContextType.add(ctor);
                  var addendum = "";
                  if (contextType === void 0) {
                    addendum = " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.";
                  } else if (typeof contextType !== "object") {
                    addendum = " However, it is set to a " + typeof contextType + ".";
                  } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
                    addendum = " Did you accidentally pass the Context.Provider instead?";
                  } else if (contextType._context !== void 0) {
                    addendum = " Did you accidentally pass the Context.Consumer instead?";
                  } else {
                    addendum = " However, it is set to an object with keys {" + Object.keys(contextType).join(", ") + "}.";
                  }
                  error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentName(ctor) || "Component", addendum);
                }
              }
            }
            if (typeof contextType === "object" && contextType !== null) {
              context = readContext(contextType);
            } else {
              unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              var contextTypes = ctor.contextTypes;
              isLegacyContextConsumer = contextTypes !== null && contextTypes !== void 0;
              context = isLegacyContextConsumer ? getMaskedContext(workInProgress2, unmaskedContext) : emptyContextObject;
            }
            {
              if (workInProgress2.mode & StrictMode) {
                disableLogs();
                try {
                  new ctor(props, context);
                } finally {
                  reenableLogs();
                }
              }
            }
            var instance = new ctor(props, context);
            var state = workInProgress2.memoizedState = instance.state !== null && instance.state !== void 0 ? instance.state : null;
            adoptClassInstance(workInProgress2, instance);
            {
              if (typeof ctor.getDerivedStateFromProps === "function" && state === null) {
                var componentName = getComponentName(ctor) || "Component";
                if (!didWarnAboutUninitializedState.has(componentName)) {
                  didWarnAboutUninitializedState.add(componentName);
                  error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", componentName, instance.state === null ? "null" : "undefined", componentName);
                }
              }
              if (typeof ctor.getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function") {
                var foundWillMountName = null;
                var foundWillReceivePropsName = null;
                var foundWillUpdateName = null;
                if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) {
                  foundWillMountName = "componentWillMount";
                } else if (typeof instance.UNSAFE_componentWillMount === "function") {
                  foundWillMountName = "UNSAFE_componentWillMount";
                }
                if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
                  foundWillReceivePropsName = "componentWillReceiveProps";
                } else if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
                  foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps";
                }
                if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
                  foundWillUpdateName = "componentWillUpdate";
                } else if (typeof instance.UNSAFE_componentWillUpdate === "function") {
                  foundWillUpdateName = "UNSAFE_componentWillUpdate";
                }
                if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
                  var _componentName = getComponentName(ctor) || "Component";
                  var newApiName = typeof ctor.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
                  if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
                    didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
                    error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://reactjs.org/link/unsafe-component-lifecycles", _componentName, newApiName, foundWillMountName !== null ? "\n  " + foundWillMountName : "", foundWillReceivePropsName !== null ? "\n  " + foundWillReceivePropsName : "", foundWillUpdateName !== null ? "\n  " + foundWillUpdateName : "");
                  }
                }
              }
            }
            if (isLegacyContextConsumer) {
              cacheContext(workInProgress2, unmaskedContext, context);
            }
            return instance;
          }
          function callComponentWillMount(workInProgress2, instance) {
            var oldState = instance.state;
            if (typeof instance.componentWillMount === "function") {
              instance.componentWillMount();
            }
            if (typeof instance.UNSAFE_componentWillMount === "function") {
              instance.UNSAFE_componentWillMount();
            }
            if (oldState !== instance.state) {
              {
                error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", getComponentName(workInProgress2.type) || "Component");
              }
              classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
            }
          }
          function callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext) {
            var oldState = instance.state;
            if (typeof instance.componentWillReceiveProps === "function") {
              instance.componentWillReceiveProps(newProps, nextContext);
            }
            if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
              instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
            }
            if (instance.state !== oldState) {
              {
                var componentName = getComponentName(workInProgress2.type) || "Component";
                if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
                  didWarnAboutStateAssignmentForComponent.add(componentName);
                  error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", componentName);
                }
              }
              classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
            }
          }
          function mountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
            {
              checkClassInstance(workInProgress2, ctor, newProps);
            }
            var instance = workInProgress2.stateNode;
            instance.props = newProps;
            instance.state = workInProgress2.memoizedState;
            instance.refs = emptyRefsObject;
            initializeUpdateQueue(workInProgress2);
            var contextType = ctor.contextType;
            if (typeof contextType === "object" && contextType !== null) {
              instance.context = readContext(contextType);
            } else {
              var unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              instance.context = getMaskedContext(workInProgress2, unmaskedContext);
            }
            {
              if (instance.state === newProps) {
                var componentName = getComponentName(ctor) || "Component";
                if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
                  didWarnAboutDirectlyAssigningPropsToState.add(componentName);
                  error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", componentName);
                }
              }
              if (workInProgress2.mode & StrictMode) {
                ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, instance);
              }
              {
                ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress2, instance);
              }
            }
            processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
            instance.state = workInProgress2.memoizedState;
            var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
            if (typeof getDerivedStateFromProps === "function") {
              applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
              instance.state = workInProgress2.memoizedState;
            }
            if (typeof ctor.getDerivedStateFromProps !== "function" && typeof instance.getSnapshotBeforeUpdate !== "function" && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
              callComponentWillMount(workInProgress2, instance);
              processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
              instance.state = workInProgress2.memoizedState;
            }
            if (typeof instance.componentDidMount === "function") {
              workInProgress2.flags |= Update;
            }
          }
          function resumeMountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
            var instance = workInProgress2.stateNode;
            var oldProps = workInProgress2.memoizedProps;
            instance.props = oldProps;
            var oldContext = instance.context;
            var contextType = ctor.contextType;
            var nextContext = emptyContextObject;
            if (typeof contextType === "object" && contextType !== null) {
              nextContext = readContext(contextType);
            } else {
              var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              nextContext = getMaskedContext(workInProgress2, nextLegacyUnmaskedContext);
            }
            var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
            var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
            if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
              if (oldProps !== newProps || oldContext !== nextContext) {
                callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
              }
            }
            resetHasForceUpdateBeforeProcessing();
            var oldState = workInProgress2.memoizedState;
            var newState = instance.state = oldState;
            processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
            newState = workInProgress2.memoizedState;
            if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
              if (typeof instance.componentDidMount === "function") {
                workInProgress2.flags |= Update;
              }
              return false;
            }
            if (typeof getDerivedStateFromProps === "function") {
              applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
              newState = workInProgress2.memoizedState;
            }
            var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext);
            if (shouldUpdate) {
              if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
                if (typeof instance.componentWillMount === "function") {
                  instance.componentWillMount();
                }
                if (typeof instance.UNSAFE_componentWillMount === "function") {
                  instance.UNSAFE_componentWillMount();
                }
              }
              if (typeof instance.componentDidMount === "function") {
                workInProgress2.flags |= Update;
              }
            } else {
              if (typeof instance.componentDidMount === "function") {
                workInProgress2.flags |= Update;
              }
              workInProgress2.memoizedProps = newProps;
              workInProgress2.memoizedState = newState;
            }
            instance.props = newProps;
            instance.state = newState;
            instance.context = nextContext;
            return shouldUpdate;
          }
          function updateClassInstance(current2, workInProgress2, ctor, newProps, renderLanes2) {
            var instance = workInProgress2.stateNode;
            cloneUpdateQueue(current2, workInProgress2);
            var unresolvedOldProps = workInProgress2.memoizedProps;
            var oldProps = workInProgress2.type === workInProgress2.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress2.type, unresolvedOldProps);
            instance.props = oldProps;
            var unresolvedNewProps = workInProgress2.pendingProps;
            var oldContext = instance.context;
            var contextType = ctor.contextType;
            var nextContext = emptyContextObject;
            if (typeof contextType === "object" && contextType !== null) {
              nextContext = readContext(contextType);
            } else {
              var nextUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              nextContext = getMaskedContext(workInProgress2, nextUnmaskedContext);
            }
            var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
            var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
            if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
              if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) {
                callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
              }
            }
            resetHasForceUpdateBeforeProcessing();
            var oldState = workInProgress2.memoizedState;
            var newState = instance.state = oldState;
            processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
            newState = workInProgress2.memoizedState;
            if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
              if (typeof instance.componentDidUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Update;
                }
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Snapshot;
                }
              }
              return false;
            }
            if (typeof getDerivedStateFromProps === "function") {
              applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
              newState = workInProgress2.memoizedState;
            }
            var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext);
            if (shouldUpdate) {
              if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === "function" || typeof instance.componentWillUpdate === "function")) {
                if (typeof instance.componentWillUpdate === "function") {
                  instance.componentWillUpdate(newProps, newState, nextContext);
                }
                if (typeof instance.UNSAFE_componentWillUpdate === "function") {
                  instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
                }
              }
              if (typeof instance.componentDidUpdate === "function") {
                workInProgress2.flags |= Update;
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function") {
                workInProgress2.flags |= Snapshot;
              }
            } else {
              if (typeof instance.componentDidUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Update;
                }
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Snapshot;
                }
              }
              workInProgress2.memoizedProps = newProps;
              workInProgress2.memoizedState = newState;
            }
            instance.props = newProps;
            instance.state = newState;
            instance.context = nextContext;
            return shouldUpdate;
          }
          var didWarnAboutMaps;
          var didWarnAboutGenerators;
          var didWarnAboutStringRefs;
          var ownerHasKeyUseWarning;
          var ownerHasFunctionTypeWarning;
          var warnForMissingKey = function(child, returnFiber) {
          };
          {
            didWarnAboutMaps = false;
            didWarnAboutGenerators = false;
            didWarnAboutStringRefs = {};
            ownerHasKeyUseWarning = {};
            ownerHasFunctionTypeWarning = {};
            warnForMissingKey = function(child, returnFiber) {
              if (child === null || typeof child !== "object") {
                return;
              }
              if (!child._store || child._store.validated || child.key != null) {
                return;
              }
              if (!(typeof child._store === "object")) {
                {
                  throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              child._store.validated = true;
              var componentName = getComponentName(returnFiber.type) || "Component";
              if (ownerHasKeyUseWarning[componentName]) {
                return;
              }
              ownerHasKeyUseWarning[componentName] = true;
              error('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.');
            };
          }
          var isArray$1 = Array.isArray;
          function coerceRef(returnFiber, current2, element) {
            var mixedRef = element.ref;
            if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") {
              {
                if ((returnFiber.mode & StrictMode || warnAboutStringRefs) && !(element._owner && element._self && element._owner.stateNode !== element._self)) {
                  var componentName = getComponentName(returnFiber.type) || "Component";
                  if (!didWarnAboutStringRefs[componentName]) {
                    {
                      error('A string ref, "%s", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', mixedRef);
                    }
                    didWarnAboutStringRefs[componentName] = true;
                  }
                }
              }
              if (element._owner) {
                var owner = element._owner;
                var inst;
                if (owner) {
                  var ownerFiber = owner;
                  if (!(ownerFiber.tag === ClassComponent)) {
                    {
                      throw Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");
                    }
                  }
                  inst = ownerFiber.stateNode;
                }
                if (!inst) {
                  {
                    throw Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
                  }
                }
                var stringRef = "" + mixedRef;
                if (current2 !== null && current2.ref !== null && typeof current2.ref === "function" && current2.ref._stringRef === stringRef) {
                  return current2.ref;
                }
                var ref = function(value) {
                  var refs = inst.refs;
                  if (refs === emptyRefsObject) {
                    refs = inst.refs = {};
                  }
                  if (value === null) {
                    delete refs[stringRef];
                  } else {
                    refs[stringRef] = value;
                  }
                };
                ref._stringRef = stringRef;
                return ref;
              } else {
                if (!(typeof mixedRef === "string")) {
                  {
                    throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
                  }
                }
                if (!element._owner) {
                  {
                    throw Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information.");
                  }
                }
              }
            }
            return mixedRef;
          }
          function throwOnInvalidObjectType(returnFiber, newChild) {
            if (returnFiber.type !== "textarea") {
              {
                {
                  throw Error("Objects are not valid as a React child (found: " + (Object.prototype.toString.call(newChild) === "[object Object]" ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : newChild) + "). If you meant to render a collection of children, use an array instead.");
                }
              }
            }
          }
          function warnOnFunctionType(returnFiber) {
            {
              var componentName = getComponentName(returnFiber.type) || "Component";
              if (ownerHasFunctionTypeWarning[componentName]) {
                return;
              }
              ownerHasFunctionTypeWarning[componentName] = true;
              error("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.");
            }
          }
          function ChildReconciler(shouldTrackSideEffects) {
            function deleteChild(returnFiber, childToDelete) {
              if (!shouldTrackSideEffects) {
                return;
              }
              var last = returnFiber.lastEffect;
              if (last !== null) {
                last.nextEffect = childToDelete;
                returnFiber.lastEffect = childToDelete;
              } else {
                returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
              }
              childToDelete.nextEffect = null;
              childToDelete.flags = Deletion;
            }
            function deleteRemainingChildren(returnFiber, currentFirstChild) {
              if (!shouldTrackSideEffects) {
                return null;
              }
              var childToDelete = currentFirstChild;
              while (childToDelete !== null) {
                deleteChild(returnFiber, childToDelete);
                childToDelete = childToDelete.sibling;
              }
              return null;
            }
            function mapRemainingChildren(returnFiber, currentFirstChild) {
              var existingChildren = /* @__PURE__ */ new Map();
              var existingChild = currentFirstChild;
              while (existingChild !== null) {
                if (existingChild.key !== null) {
                  existingChildren.set(existingChild.key, existingChild);
                } else {
                  existingChildren.set(existingChild.index, existingChild);
                }
                existingChild = existingChild.sibling;
              }
              return existingChildren;
            }
            function useFiber(fiber, pendingProps) {
              var clone = createWorkInProgress(fiber, pendingProps);
              clone.index = 0;
              clone.sibling = null;
              return clone;
            }
            function placeChild(newFiber, lastPlacedIndex, newIndex) {
              newFiber.index = newIndex;
              if (!shouldTrackSideEffects) {
                return lastPlacedIndex;
              }
              var current2 = newFiber.alternate;
              if (current2 !== null) {
                var oldIndex = current2.index;
                if (oldIndex < lastPlacedIndex) {
                  newFiber.flags = Placement;
                  return lastPlacedIndex;
                } else {
                  return oldIndex;
                }
              } else {
                newFiber.flags = Placement;
                return lastPlacedIndex;
              }
            }
            function placeSingleChild(newFiber) {
              if (shouldTrackSideEffects && newFiber.alternate === null) {
                newFiber.flags = Placement;
              }
              return newFiber;
            }
            function updateTextNode(returnFiber, current2, textContent, lanes) {
              if (current2 === null || current2.tag !== HostText) {
                var created = createFiberFromText(textContent, returnFiber.mode, lanes);
                created.return = returnFiber;
                return created;
              } else {
                var existing = useFiber(current2, textContent);
                existing.return = returnFiber;
                return existing;
              }
            }
            function updateElement(returnFiber, current2, element, lanes) {
              if (current2 !== null) {
                if (current2.elementType === element.type || isCompatibleFamilyForHotReloading(current2, element)) {
                  var existing = useFiber(current2, element.props);
                  existing.ref = coerceRef(returnFiber, current2, element);
                  existing.return = returnFiber;
                  {
                    existing._debugSource = element._source;
                    existing._debugOwner = element._owner;
                  }
                  return existing;
                }
              }
              var created = createFiberFromElement(element, returnFiber.mode, lanes);
              created.ref = coerceRef(returnFiber, current2, element);
              created.return = returnFiber;
              return created;
            }
            function updatePortal(returnFiber, current2, portal, lanes) {
              if (current2 === null || current2.tag !== HostPortal || current2.stateNode.containerInfo !== portal.containerInfo || current2.stateNode.implementation !== portal.implementation) {
                var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
                created.return = returnFiber;
                return created;
              } else {
                var existing = useFiber(current2, portal.children || []);
                existing.return = returnFiber;
                return existing;
              }
            }
            function updateFragment2(returnFiber, current2, fragment, lanes, key2) {
              if (current2 === null || current2.tag !== Fragment6) {
                var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key2);
                created.return = returnFiber;
                return created;
              } else {
                var existing = useFiber(current2, fragment);
                existing.return = returnFiber;
                return existing;
              }
            }
            function createChild(returnFiber, newChild, lanes) {
              if (typeof newChild === "string" || typeof newChild === "number") {
                var created = createFiberFromText("" + newChild, returnFiber.mode, lanes);
                created.return = returnFiber;
                return created;
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE: {
                    var _created = createFiberFromElement(newChild, returnFiber.mode, lanes);
                    _created.ref = coerceRef(returnFiber, null, newChild);
                    _created.return = returnFiber;
                    return _created;
                  }
                  case REACT_PORTAL_TYPE: {
                    var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes);
                    _created2.return = returnFiber;
                    return _created2;
                  }
                }
                if (isArray$1(newChild) || getIteratorFn(newChild)) {
                  var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);
                  _created3.return = returnFiber;
                  return _created3;
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return null;
            }
            function updateSlot(returnFiber, oldFiber, newChild, lanes) {
              var key2 = oldFiber !== null ? oldFiber.key : null;
              if (typeof newChild === "string" || typeof newChild === "number") {
                if (key2 !== null) {
                  return null;
                }
                return updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE: {
                    if (newChild.key === key2) {
                      if (newChild.type === REACT_FRAGMENT_TYPE) {
                        return updateFragment2(returnFiber, oldFiber, newChild.props.children, lanes, key2);
                      }
                      return updateElement(returnFiber, oldFiber, newChild, lanes);
                    } else {
                      return null;
                    }
                  }
                  case REACT_PORTAL_TYPE: {
                    if (newChild.key === key2) {
                      return updatePortal(returnFiber, oldFiber, newChild, lanes);
                    } else {
                      return null;
                    }
                  }
                }
                if (isArray$1(newChild) || getIteratorFn(newChild)) {
                  if (key2 !== null) {
                    return null;
                  }
                  return updateFragment2(returnFiber, oldFiber, newChild, lanes, null);
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return null;
            }
            function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
              if (typeof newChild === "string" || typeof newChild === "number") {
                var matchedFiber = existingChildren.get(newIdx) || null;
                return updateTextNode(returnFiber, matchedFiber, "" + newChild, lanes);
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE: {
                    var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
                    if (newChild.type === REACT_FRAGMENT_TYPE) {
                      return updateFragment2(returnFiber, _matchedFiber, newChild.props.children, lanes, newChild.key);
                    }
                    return updateElement(returnFiber, _matchedFiber, newChild, lanes);
                  }
                  case REACT_PORTAL_TYPE: {
                    var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
                    return updatePortal(returnFiber, _matchedFiber2, newChild, lanes);
                  }
                }
                if (isArray$1(newChild) || getIteratorFn(newChild)) {
                  var _matchedFiber3 = existingChildren.get(newIdx) || null;
                  return updateFragment2(returnFiber, _matchedFiber3, newChild, lanes, null);
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return null;
            }
            function warnOnInvalidKey(child, knownKeys, returnFiber) {
              {
                if (typeof child !== "object" || child === null) {
                  return knownKeys;
                }
                switch (child.$$typeof) {
                  case REACT_ELEMENT_TYPE:
                  case REACT_PORTAL_TYPE:
                    warnForMissingKey(child, returnFiber);
                    var key2 = child.key;
                    if (typeof key2 !== "string") {
                      break;
                    }
                    if (knownKeys === null) {
                      knownKeys = /* @__PURE__ */ new Set();
                      knownKeys.add(key2);
                      break;
                    }
                    if (!knownKeys.has(key2)) {
                      knownKeys.add(key2);
                      break;
                    }
                    error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", key2);
                    break;
                }
              }
              return knownKeys;
            }
            function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
              {
                var knownKeys = null;
                for (var i = 0; i < newChildren.length; i++) {
                  var child = newChildren[i];
                  knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
                }
              }
              var resultingFirstChild = null;
              var previousNewFiber = null;
              var oldFiber = currentFirstChild;
              var lastPlacedIndex = 0;
              var newIdx = 0;
              var nextOldFiber = null;
              for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
                if (oldFiber.index > newIdx) {
                  nextOldFiber = oldFiber;
                  oldFiber = null;
                } else {
                  nextOldFiber = oldFiber.sibling;
                }
                var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes);
                if (newFiber === null) {
                  if (oldFiber === null) {
                    oldFiber = nextOldFiber;
                  }
                  break;
                }
                if (shouldTrackSideEffects) {
                  if (oldFiber && newFiber.alternate === null) {
                    deleteChild(returnFiber, oldFiber);
                  }
                }
                lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
                if (previousNewFiber === null) {
                  resultingFirstChild = newFiber;
                } else {
                  previousNewFiber.sibling = newFiber;
                }
                previousNewFiber = newFiber;
                oldFiber = nextOldFiber;
              }
              if (newIdx === newChildren.length) {
                deleteRemainingChildren(returnFiber, oldFiber);
                return resultingFirstChild;
              }
              if (oldFiber === null) {
                for (; newIdx < newChildren.length; newIdx++) {
                  var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes);
                  if (_newFiber === null) {
                    continue;
                  }
                  lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber;
                  } else {
                    previousNewFiber.sibling = _newFiber;
                  }
                  previousNewFiber = _newFiber;
                }
                return resultingFirstChild;
              }
              var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
              for (; newIdx < newChildren.length; newIdx++) {
                var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes);
                if (_newFiber2 !== null) {
                  if (shouldTrackSideEffects) {
                    if (_newFiber2.alternate !== null) {
                      existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
                    }
                  }
                  lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber2;
                  } else {
                    previousNewFiber.sibling = _newFiber2;
                  }
                  previousNewFiber = _newFiber2;
                }
              }
              if (shouldTrackSideEffects) {
                existingChildren.forEach(function(child2) {
                  return deleteChild(returnFiber, child2);
                });
              }
              return resultingFirstChild;
            }
            function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {
              var iteratorFn = getIteratorFn(newChildrenIterable);
              if (!(typeof iteratorFn === "function")) {
                {
                  throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              {
                if (typeof Symbol === "function" && newChildrenIterable[Symbol.toStringTag] === "Generator") {
                  if (!didWarnAboutGenerators) {
                    error("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers.");
                  }
                  didWarnAboutGenerators = true;
                }
                if (newChildrenIterable.entries === iteratorFn) {
                  if (!didWarnAboutMaps) {
                    error("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
                  }
                  didWarnAboutMaps = true;
                }
                var _newChildren = iteratorFn.call(newChildrenIterable);
                if (_newChildren) {
                  var knownKeys = null;
                  var _step = _newChildren.next();
                  for (; !_step.done; _step = _newChildren.next()) {
                    var child = _step.value;
                    knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
                  }
                }
              }
              var newChildren = iteratorFn.call(newChildrenIterable);
              if (!(newChildren != null)) {
                {
                  throw Error("An iterable object provided no iterator.");
                }
              }
              var resultingFirstChild = null;
              var previousNewFiber = null;
              var oldFiber = currentFirstChild;
              var lastPlacedIndex = 0;
              var newIdx = 0;
              var nextOldFiber = null;
              var step = newChildren.next();
              for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
                if (oldFiber.index > newIdx) {
                  nextOldFiber = oldFiber;
                  oldFiber = null;
                } else {
                  nextOldFiber = oldFiber.sibling;
                }
                var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
                if (newFiber === null) {
                  if (oldFiber === null) {
                    oldFiber = nextOldFiber;
                  }
                  break;
                }
                if (shouldTrackSideEffects) {
                  if (oldFiber && newFiber.alternate === null) {
                    deleteChild(returnFiber, oldFiber);
                  }
                }
                lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
                if (previousNewFiber === null) {
                  resultingFirstChild = newFiber;
                } else {
                  previousNewFiber.sibling = newFiber;
                }
                previousNewFiber = newFiber;
                oldFiber = nextOldFiber;
              }
              if (step.done) {
                deleteRemainingChildren(returnFiber, oldFiber);
                return resultingFirstChild;
              }
              if (oldFiber === null) {
                for (; !step.done; newIdx++, step = newChildren.next()) {
                  var _newFiber3 = createChild(returnFiber, step.value, lanes);
                  if (_newFiber3 === null) {
                    continue;
                  }
                  lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber3;
                  } else {
                    previousNewFiber.sibling = _newFiber3;
                  }
                  previousNewFiber = _newFiber3;
                }
                return resultingFirstChild;
              }
              var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
              for (; !step.done; newIdx++, step = newChildren.next()) {
                var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes);
                if (_newFiber4 !== null) {
                  if (shouldTrackSideEffects) {
                    if (_newFiber4.alternate !== null) {
                      existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
                    }
                  }
                  lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber4;
                  } else {
                    previousNewFiber.sibling = _newFiber4;
                  }
                  previousNewFiber = _newFiber4;
                }
              }
              if (shouldTrackSideEffects) {
                existingChildren.forEach(function(child2) {
                  return deleteChild(returnFiber, child2);
                });
              }
              return resultingFirstChild;
            }
            function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) {
              if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
                deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
                var existing = useFiber(currentFirstChild, textContent);
                existing.return = returnFiber;
                return existing;
              }
              deleteRemainingChildren(returnFiber, currentFirstChild);
              var created = createFiberFromText(textContent, returnFiber.mode, lanes);
              created.return = returnFiber;
              return created;
            }
            function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {
              var key2 = element.key;
              var child = currentFirstChild;
              while (child !== null) {
                if (child.key === key2) {
                  switch (child.tag) {
                    case Fragment6: {
                      if (element.type === REACT_FRAGMENT_TYPE) {
                        deleteRemainingChildren(returnFiber, child.sibling);
                        var existing = useFiber(child, element.props.children);
                        existing.return = returnFiber;
                        {
                          existing._debugSource = element._source;
                          existing._debugOwner = element._owner;
                        }
                        return existing;
                      }
                      break;
                    }
                    case Block:
                    default: {
                      if (child.elementType === element.type || isCompatibleFamilyForHotReloading(child, element)) {
                        deleteRemainingChildren(returnFiber, child.sibling);
                        var _existing3 = useFiber(child, element.props);
                        _existing3.ref = coerceRef(returnFiber, child, element);
                        _existing3.return = returnFiber;
                        {
                          _existing3._debugSource = element._source;
                          _existing3._debugOwner = element._owner;
                        }
                        return _existing3;
                      }
                      break;
                    }
                  }
                  deleteRemainingChildren(returnFiber, child);
                  break;
                } else {
                  deleteChild(returnFiber, child);
                }
                child = child.sibling;
              }
              if (element.type === REACT_FRAGMENT_TYPE) {
                var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);
                created.return = returnFiber;
                return created;
              } else {
                var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);
                _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
                _created4.return = returnFiber;
                return _created4;
              }
            }
            function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {
              var key2 = portal.key;
              var child = currentFirstChild;
              while (child !== null) {
                if (child.key === key2) {
                  if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
                    deleteRemainingChildren(returnFiber, child.sibling);
                    var existing = useFiber(child, portal.children || []);
                    existing.return = returnFiber;
                    return existing;
                  } else {
                    deleteRemainingChildren(returnFiber, child);
                    break;
                  }
                } else {
                  deleteChild(returnFiber, child);
                }
                child = child.sibling;
              }
              var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
              created.return = returnFiber;
              return created;
            }
            function reconcileChildFibers2(returnFiber, currentFirstChild, newChild, lanes) {
              var isUnkeyedTopLevelFragment = typeof newChild === "object" && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
              if (isUnkeyedTopLevelFragment) {
                newChild = newChild.props.children;
              }
              var isObject = typeof newChild === "object" && newChild !== null;
              if (isObject) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE:
                    return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes));
                  case REACT_PORTAL_TYPE:
                    return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes));
                }
              }
              if (typeof newChild === "string" || typeof newChild === "number") {
                return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, lanes));
              }
              if (isArray$1(newChild)) {
                return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);
              }
              if (getIteratorFn(newChild)) {
                return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);
              }
              if (isObject) {
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              if (typeof newChild === "undefined" && !isUnkeyedTopLevelFragment) {
                switch (returnFiber.tag) {
                  case ClassComponent: {
                    {
                      var instance = returnFiber.stateNode;
                      if (instance.render._isMockFunction) {
                        break;
                      }
                    }
                  }
                  case Block:
                  case FunctionComponent:
                  case ForwardRef:
                  case SimpleMemoComponent: {
                    {
                      {
                        throw Error((getComponentName(returnFiber.type) || "Component") + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.");
                      }
                    }
                  }
                }
              }
              return deleteRemainingChildren(returnFiber, currentFirstChild);
            }
            return reconcileChildFibers2;
          }
          var reconcileChildFibers = ChildReconciler(true);
          var mountChildFibers = ChildReconciler(false);
          function cloneChildFibers(current2, workInProgress2) {
            if (!(current2 === null || workInProgress2.child === current2.child)) {
              {
                throw Error("Resuming work not yet implemented.");
              }
            }
            if (workInProgress2.child === null) {
              return;
            }
            var currentChild = workInProgress2.child;
            var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);
            workInProgress2.child = newChild;
            newChild.return = workInProgress2;
            while (currentChild.sibling !== null) {
              currentChild = currentChild.sibling;
              newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);
              newChild.return = workInProgress2;
            }
            newChild.sibling = null;
          }
          function resetChildFibers(workInProgress2, lanes) {
            var child = workInProgress2.child;
            while (child !== null) {
              resetWorkInProgress(child, lanes);
              child = child.sibling;
            }
          }
          var NO_CONTEXT = {};
          var contextStackCursor$1 = createCursor(NO_CONTEXT);
          var contextFiberStackCursor = createCursor(NO_CONTEXT);
          var rootInstanceStackCursor = createCursor(NO_CONTEXT);
          function requiredContext(c) {
            if (!(c !== NO_CONTEXT)) {
              {
                throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            return c;
          }
          function getRootHostContainer() {
            var rootInstance = requiredContext(rootInstanceStackCursor.current);
            return rootInstance;
          }
          function pushHostContainer(fiber, nextRootInstance) {
            push(rootInstanceStackCursor, nextRootInstance, fiber);
            push(contextFiberStackCursor, fiber, fiber);
            push(contextStackCursor$1, NO_CONTEXT, fiber);
            var nextRootContext = getRootHostContext(nextRootInstance);
            pop(contextStackCursor$1, fiber);
            push(contextStackCursor$1, nextRootContext, fiber);
          }
          function popHostContainer(fiber) {
            pop(contextStackCursor$1, fiber);
            pop(contextFiberStackCursor, fiber);
            pop(rootInstanceStackCursor, fiber);
          }
          function getHostContext() {
            var context = requiredContext(contextStackCursor$1.current);
            return context;
          }
          function pushHostContext(fiber) {
            var rootInstance = requiredContext(rootInstanceStackCursor.current);
            var context = requiredContext(contextStackCursor$1.current);
            var nextContext = getChildHostContext(context, fiber.type);
            if (context === nextContext) {
              return;
            }
            push(contextFiberStackCursor, fiber, fiber);
            push(contextStackCursor$1, nextContext, fiber);
          }
          function popHostContext(fiber) {
            if (contextFiberStackCursor.current !== fiber) {
              return;
            }
            pop(contextStackCursor$1, fiber);
            pop(contextFiberStackCursor, fiber);
          }
          var DefaultSuspenseContext = 0;
          var SubtreeSuspenseContextMask = 1;
          var InvisibleParentSuspenseContext = 1;
          var ForceSuspenseFallback = 2;
          var suspenseStackCursor = createCursor(DefaultSuspenseContext);
          function hasSuspenseContext(parentContext, flag) {
            return (parentContext & flag) !== 0;
          }
          function setDefaultShallowSuspenseContext(parentContext) {
            return parentContext & SubtreeSuspenseContextMask;
          }
          function setShallowSuspenseContext(parentContext, shallowContext) {
            return parentContext & SubtreeSuspenseContextMask | shallowContext;
          }
          function addSubtreeSuspenseContext(parentContext, subtreeContext) {
            return parentContext | subtreeContext;
          }
          function pushSuspenseContext(fiber, newContext) {
            push(suspenseStackCursor, newContext, fiber);
          }
          function popSuspenseContext(fiber) {
            pop(suspenseStackCursor, fiber);
          }
          function shouldCaptureSuspense(workInProgress2, hasInvisibleParent) {
            var nextState = workInProgress2.memoizedState;
            if (nextState !== null) {
              if (nextState.dehydrated !== null) {
                return true;
              }
              return false;
            }
            var props = workInProgress2.memoizedProps;
            if (props.fallback === void 0) {
              return false;
            }
            if (props.unstable_avoidThisFallback !== true) {
              return true;
            }
            if (hasInvisibleParent) {
              return false;
            }
            return true;
          }
          function findFirstSuspended(row) {
            var node = row;
            while (node !== null) {
              if (node.tag === SuspenseComponent) {
                var state = node.memoizedState;
                if (state !== null) {
                  var dehydrated = state.dehydrated;
                  if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
                    return node;
                  }
                }
              } else if (node.tag === SuspenseListComponent && node.memoizedProps.revealOrder !== void 0) {
                var didSuspend = (node.flags & DidCapture) !== NoFlags;
                if (didSuspend) {
                  return node;
                }
              } else if (node.child !== null) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === row) {
                return null;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === row) {
                  return null;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
            return null;
          }
          var NoFlags$1 = 0;
          var HasEffect = 1;
          var Layout = 2;
          var Passive$1 = 4;
          var hydrationParentFiber = null;
          var nextHydratableInstance = null;
          var isHydrating = false;
          function enterHydrationState(fiber) {
            var parentInstance = fiber.stateNode.containerInfo;
            nextHydratableInstance = getFirstHydratableChild(parentInstance);
            hydrationParentFiber = fiber;
            isHydrating = true;
            return true;
          }
          function deleteHydratableInstance(returnFiber, instance) {
            {
              switch (returnFiber.tag) {
                case HostRoot:
                  didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
                  break;
                case HostComponent:
                  didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
                  break;
              }
            }
            var childToDelete = createFiberFromHostInstanceForDeletion();
            childToDelete.stateNode = instance;
            childToDelete.return = returnFiber;
            childToDelete.flags = Deletion;
            if (returnFiber.lastEffect !== null) {
              returnFiber.lastEffect.nextEffect = childToDelete;
              returnFiber.lastEffect = childToDelete;
            } else {
              returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
            }
          }
          function insertNonHydratedInstance(returnFiber, fiber) {
            fiber.flags = fiber.flags & ~Hydrating | Placement;
            {
              switch (returnFiber.tag) {
                case HostRoot: {
                  var parentContainer = returnFiber.stateNode.containerInfo;
                  switch (fiber.tag) {
                    case HostComponent:
                      var type = fiber.type;
                      var props = fiber.pendingProps;
                      didNotFindHydratableContainerInstance(parentContainer, type);
                      break;
                    case HostText:
                      var text = fiber.pendingProps;
                      didNotFindHydratableContainerTextInstance(parentContainer, text);
                      break;
                  }
                  break;
                }
                case HostComponent: {
                  var parentType = returnFiber.type;
                  var parentProps = returnFiber.memoizedProps;
                  var parentInstance = returnFiber.stateNode;
                  switch (fiber.tag) {
                    case HostComponent:
                      var _type = fiber.type;
                      var _props = fiber.pendingProps;
                      didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type);
                      break;
                    case HostText:
                      var _text = fiber.pendingProps;
                      didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
                      break;
                    case SuspenseComponent:
                      didNotFindHydratableSuspenseInstance(parentType, parentProps);
                      break;
                  }
                  break;
                }
                default:
                  return;
              }
            }
          }
          function tryHydrate(fiber, nextInstance) {
            switch (fiber.tag) {
              case HostComponent: {
                var type = fiber.type;
                var props = fiber.pendingProps;
                var instance = canHydrateInstance(nextInstance, type);
                if (instance !== null) {
                  fiber.stateNode = instance;
                  return true;
                }
                return false;
              }
              case HostText: {
                var text = fiber.pendingProps;
                var textInstance = canHydrateTextInstance(nextInstance, text);
                if (textInstance !== null) {
                  fiber.stateNode = textInstance;
                  return true;
                }
                return false;
              }
              case SuspenseComponent: {
                return false;
              }
              default:
                return false;
            }
          }
          function tryToClaimNextHydratableInstance(fiber) {
            if (!isHydrating) {
              return;
            }
            var nextInstance = nextHydratableInstance;
            if (!nextInstance) {
              insertNonHydratedInstance(hydrationParentFiber, fiber);
              isHydrating = false;
              hydrationParentFiber = fiber;
              return;
            }
            var firstAttemptedInstance = nextInstance;
            if (!tryHydrate(fiber, nextInstance)) {
              nextInstance = getNextHydratableSibling(firstAttemptedInstance);
              if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
                insertNonHydratedInstance(hydrationParentFiber, fiber);
                isHydrating = false;
                hydrationParentFiber = fiber;
                return;
              }
              deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);
            }
            hydrationParentFiber = fiber;
            nextHydratableInstance = getFirstHydratableChild(nextInstance);
          }
          function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
            var instance = fiber.stateNode;
            var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber);
            fiber.updateQueue = updatePayload;
            if (updatePayload !== null) {
              return true;
            }
            return false;
          }
          function prepareToHydrateHostTextInstance(fiber) {
            var textInstance = fiber.stateNode;
            var textContent = fiber.memoizedProps;
            var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
            {
              if (shouldUpdate) {
                var returnFiber = hydrationParentFiber;
                if (returnFiber !== null) {
                  switch (returnFiber.tag) {
                    case HostRoot: {
                      var parentContainer = returnFiber.stateNode.containerInfo;
                      didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
                      break;
                    }
                    case HostComponent: {
                      var parentType = returnFiber.type;
                      var parentProps = returnFiber.memoizedProps;
                      var parentInstance = returnFiber.stateNode;
                      didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
                      break;
                    }
                  }
                }
              }
            }
            return shouldUpdate;
          }
          function skipPastDehydratedSuspenseInstance(fiber) {
            var suspenseState = fiber.memoizedState;
            var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
            if (!suspenseInstance) {
              {
                throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
          }
          function popToNextHostParent(fiber) {
            var parent = fiber.return;
            while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {
              parent = parent.return;
            }
            hydrationParentFiber = parent;
          }
          function popHydrationState(fiber) {
            if (fiber !== hydrationParentFiber) {
              return false;
            }
            if (!isHydrating) {
              popToNextHostParent(fiber);
              isHydrating = true;
              return false;
            }
            var type = fiber.type;
            if (fiber.tag !== HostComponent || type !== "head" && type !== "body" && !shouldSetTextContent(type, fiber.memoizedProps)) {
              var nextInstance = nextHydratableInstance;
              while (nextInstance) {
                deleteHydratableInstance(fiber, nextInstance);
                nextInstance = getNextHydratableSibling(nextInstance);
              }
            }
            popToNextHostParent(fiber);
            if (fiber.tag === SuspenseComponent) {
              nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
            } else {
              nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
            }
            return true;
          }
          function resetHydrationState() {
            hydrationParentFiber = null;
            nextHydratableInstance = null;
            isHydrating = false;
          }
          function getIsHydrating() {
            return isHydrating;
          }
          var workInProgressSources = [];
          var rendererSigil$1;
          {
            rendererSigil$1 = {};
          }
          function markSourceAsDirty(mutableSource) {
            workInProgressSources.push(mutableSource);
          }
          function resetWorkInProgressVersions() {
            for (var i = 0; i < workInProgressSources.length; i++) {
              var mutableSource = workInProgressSources[i];
              {
                mutableSource._workInProgressVersionPrimary = null;
              }
            }
            workInProgressSources.length = 0;
          }
          function getWorkInProgressVersion(mutableSource) {
            {
              return mutableSource._workInProgressVersionPrimary;
            }
          }
          function setWorkInProgressVersion(mutableSource, version) {
            {
              mutableSource._workInProgressVersionPrimary = version;
            }
            workInProgressSources.push(mutableSource);
          }
          function warnAboutMultipleRenderersDEV(mutableSource) {
            {
              {
                if (mutableSource._currentPrimaryRenderer == null) {
                  mutableSource._currentPrimaryRenderer = rendererSigil$1;
                } else if (mutableSource._currentPrimaryRenderer !== rendererSigil$1) {
                  error("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported.");
                }
              }
            }
          }
          var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
          var didWarnAboutMismatchedHooksForComponent;
          var didWarnAboutUseOpaqueIdentifier;
          {
            didWarnAboutUseOpaqueIdentifier = {};
            didWarnAboutMismatchedHooksForComponent = /* @__PURE__ */ new Set();
          }
          var renderLanes = NoLanes;
          var currentlyRenderingFiber$1 = null;
          var currentHook = null;
          var workInProgressHook = null;
          var didScheduleRenderPhaseUpdate = false;
          var didScheduleRenderPhaseUpdateDuringThisPass = false;
          var RE_RENDER_LIMIT = 25;
          var currentHookNameInDev = null;
          var hookTypesDev = null;
          var hookTypesUpdateIndexDev = -1;
          var ignorePreviousDependencies = false;
          function mountHookTypesDev() {
            {
              var hookName = currentHookNameInDev;
              if (hookTypesDev === null) {
                hookTypesDev = [hookName];
              } else {
                hookTypesDev.push(hookName);
              }
            }
          }
          function updateHookTypesDev() {
            {
              var hookName = currentHookNameInDev;
              if (hookTypesDev !== null) {
                hookTypesUpdateIndexDev++;
                if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
                  warnOnHookMismatchInDev(hookName);
                }
              }
            }
          }
          function checkDepsAreArrayDev(deps) {
            {
              if (deps !== void 0 && deps !== null && !Array.isArray(deps)) {
                error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", currentHookNameInDev, typeof deps);
              }
            }
          }
          function warnOnHookMismatchInDev(currentHookName) {
            {
              var componentName = getComponentName(currentlyRenderingFiber$1.type);
              if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
                didWarnAboutMismatchedHooksForComponent.add(componentName);
                if (hookTypesDev !== null) {
                  var table = "";
                  var secondColumnStart = 30;
                  for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
                    var oldHookName = hookTypesDev[i];
                    var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
                    var row = i + 1 + ". " + oldHookName;
                    while (row.length < secondColumnStart) {
                      row += " ";
                    }
                    row += newHookName + "\n";
                    table += row;
                  }
                  error("React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n   Previous render            Next render\n   ------------------------------------------------------\n%s   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", componentName, table);
                }
              }
            }
          }
          function throwInvalidHookError() {
            {
              {
                throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
              }
            }
          }
          function areHookInputsEqual(nextDeps, prevDeps) {
            {
              if (ignorePreviousDependencies) {
                return false;
              }
            }
            if (prevDeps === null) {
              {
                error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", currentHookNameInDev);
              }
              return false;
            }
            {
              if (nextDeps.length !== prevDeps.length) {
                error("The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + nextDeps.join(", ") + "]");
              }
            }
            for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
              if (objectIs(nextDeps[i], prevDeps[i])) {
                continue;
              }
              return false;
            }
            return true;
          }
          function renderWithHooks(current2, workInProgress2, Component2, props, secondArg, nextRenderLanes) {
            renderLanes = nextRenderLanes;
            currentlyRenderingFiber$1 = workInProgress2;
            {
              hookTypesDev = current2 !== null ? current2._debugHookTypes : null;
              hookTypesUpdateIndexDev = -1;
              ignorePreviousDependencies = current2 !== null && current2.type !== workInProgress2.type;
            }
            workInProgress2.memoizedState = null;
            workInProgress2.updateQueue = null;
            workInProgress2.lanes = NoLanes;
            {
              if (current2 !== null && current2.memoizedState !== null) {
                ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
              } else if (hookTypesDev !== null) {
                ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
              } else {
                ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
              }
            }
            var children = Component2(props, secondArg);
            if (didScheduleRenderPhaseUpdateDuringThisPass) {
              var numberOfReRenders = 0;
              do {
                didScheduleRenderPhaseUpdateDuringThisPass = false;
                if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
                  {
                    throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
                  }
                }
                numberOfReRenders += 1;
                {
                  ignorePreviousDependencies = false;
                }
                currentHook = null;
                workInProgressHook = null;
                workInProgress2.updateQueue = null;
                {
                  hookTypesUpdateIndexDev = -1;
                }
                ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV;
                children = Component2(props, secondArg);
              } while (didScheduleRenderPhaseUpdateDuringThisPass);
            }
            ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
            {
              workInProgress2._debugHookTypes = hookTypesDev;
            }
            var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
            renderLanes = NoLanes;
            currentlyRenderingFiber$1 = null;
            currentHook = null;
            workInProgressHook = null;
            {
              currentHookNameInDev = null;
              hookTypesDev = null;
              hookTypesUpdateIndexDev = -1;
            }
            didScheduleRenderPhaseUpdate = false;
            if (!!didRenderTooFewHooks) {
              {
                throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
              }
            }
            return children;
          }
          function bailoutHooks(current2, workInProgress2, lanes) {
            workInProgress2.updateQueue = current2.updateQueue;
            workInProgress2.flags &= ~(Passive | Update);
            current2.lanes = removeLanes(current2.lanes, lanes);
          }
          function resetHooksAfterThrow() {
            ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
            if (didScheduleRenderPhaseUpdate) {
              var hook = currentlyRenderingFiber$1.memoizedState;
              while (hook !== null) {
                var queue = hook.queue;
                if (queue !== null) {
                  queue.pending = null;
                }
                hook = hook.next;
              }
              didScheduleRenderPhaseUpdate = false;
            }
            renderLanes = NoLanes;
            currentlyRenderingFiber$1 = null;
            currentHook = null;
            workInProgressHook = null;
            {
              hookTypesDev = null;
              hookTypesUpdateIndexDev = -1;
              currentHookNameInDev = null;
              isUpdatingOpaqueValueInRenderPhase = false;
            }
            didScheduleRenderPhaseUpdateDuringThisPass = false;
          }
          function mountWorkInProgressHook() {
            var hook = {
              memoizedState: null,
              baseState: null,
              baseQueue: null,
              queue: null,
              next: null
            };
            if (workInProgressHook === null) {
              currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;
            } else {
              workInProgressHook = workInProgressHook.next = hook;
            }
            return workInProgressHook;
          }
          function updateWorkInProgressHook() {
            var nextCurrentHook;
            if (currentHook === null) {
              var current2 = currentlyRenderingFiber$1.alternate;
              if (current2 !== null) {
                nextCurrentHook = current2.memoizedState;
              } else {
                nextCurrentHook = null;
              }
            } else {
              nextCurrentHook = currentHook.next;
            }
            var nextWorkInProgressHook;
            if (workInProgressHook === null) {
              nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;
            } else {
              nextWorkInProgressHook = workInProgressHook.next;
            }
            if (nextWorkInProgressHook !== null) {
              workInProgressHook = nextWorkInProgressHook;
              nextWorkInProgressHook = workInProgressHook.next;
              currentHook = nextCurrentHook;
            } else {
              if (!(nextCurrentHook !== null)) {
                {
                  throw Error("Rendered more hooks than during the previous render.");
                }
              }
              currentHook = nextCurrentHook;
              var newHook = {
                memoizedState: currentHook.memoizedState,
                baseState: currentHook.baseState,
                baseQueue: currentHook.baseQueue,
                queue: currentHook.queue,
                next: null
              };
              if (workInProgressHook === null) {
                currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;
              } else {
                workInProgressHook = workInProgressHook.next = newHook;
              }
            }
            return workInProgressHook;
          }
          function createFunctionComponentUpdateQueue() {
            return {
              lastEffect: null
            };
          }
          function basicStateReducer(state, action) {
            return typeof action === "function" ? action(state) : action;
          }
          function mountReducer(reducer, initialArg, init) {
            var hook = mountWorkInProgressHook();
            var initialState;
            if (init !== void 0) {
              initialState = init(initialArg);
            } else {
              initialState = initialArg;
            }
            hook.memoizedState = hook.baseState = initialState;
            var queue = hook.queue = {
              pending: null,
              dispatch: null,
              lastRenderedReducer: reducer,
              lastRenderedState: initialState
            };
            var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
            return [hook.memoizedState, dispatch];
          }
          function updateReducer(reducer, initialArg, init) {
            var hook = updateWorkInProgressHook();
            var queue = hook.queue;
            if (!(queue !== null)) {
              {
                throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
              }
            }
            queue.lastRenderedReducer = reducer;
            var current2 = currentHook;
            var baseQueue = current2.baseQueue;
            var pendingQueue = queue.pending;
            if (pendingQueue !== null) {
              if (baseQueue !== null) {
                var baseFirst = baseQueue.next;
                var pendingFirst = pendingQueue.next;
                baseQueue.next = pendingFirst;
                pendingQueue.next = baseFirst;
              }
              {
                if (current2.baseQueue !== baseQueue) {
                  error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React.");
                }
              }
              current2.baseQueue = baseQueue = pendingQueue;
              queue.pending = null;
            }
            if (baseQueue !== null) {
              var first = baseQueue.next;
              var newState = current2.baseState;
              var newBaseState = null;
              var newBaseQueueFirst = null;
              var newBaseQueueLast = null;
              var update = first;
              do {
                var updateLane = update.lane;
                if (!isSubsetOfLanes(renderLanes, updateLane)) {
                  var clone = {
                    lane: updateLane,
                    action: update.action,
                    eagerReducer: update.eagerReducer,
                    eagerState: update.eagerState,
                    next: null
                  };
                  if (newBaseQueueLast === null) {
                    newBaseQueueFirst = newBaseQueueLast = clone;
                    newBaseState = newState;
                  } else {
                    newBaseQueueLast = newBaseQueueLast.next = clone;
                  }
                  currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);
                  markSkippedUpdateLanes(updateLane);
                } else {
                  if (newBaseQueueLast !== null) {
                    var _clone = {
                      lane: NoLane,
                      action: update.action,
                      eagerReducer: update.eagerReducer,
                      eagerState: update.eagerState,
                      next: null
                    };
                    newBaseQueueLast = newBaseQueueLast.next = _clone;
                  }
                  if (update.eagerReducer === reducer) {
                    newState = update.eagerState;
                  } else {
                    var action = update.action;
                    newState = reducer(newState, action);
                  }
                }
                update = update.next;
              } while (update !== null && update !== first);
              if (newBaseQueueLast === null) {
                newBaseState = newState;
              } else {
                newBaseQueueLast.next = newBaseQueueFirst;
              }
              if (!objectIs(newState, hook.memoizedState)) {
                markWorkInProgressReceivedUpdate();
              }
              hook.memoizedState = newState;
              hook.baseState = newBaseState;
              hook.baseQueue = newBaseQueueLast;
              queue.lastRenderedState = newState;
            }
            var dispatch = queue.dispatch;
            return [hook.memoizedState, dispatch];
          }
          function rerenderReducer(reducer, initialArg, init) {
            var hook = updateWorkInProgressHook();
            var queue = hook.queue;
            if (!(queue !== null)) {
              {
                throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
              }
            }
            queue.lastRenderedReducer = reducer;
            var dispatch = queue.dispatch;
            var lastRenderPhaseUpdate = queue.pending;
            var newState = hook.memoizedState;
            if (lastRenderPhaseUpdate !== null) {
              queue.pending = null;
              var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;
              var update = firstRenderPhaseUpdate;
              do {
                var action = update.action;
                newState = reducer(newState, action);
                update = update.next;
              } while (update !== firstRenderPhaseUpdate);
              if (!objectIs(newState, hook.memoizedState)) {
                markWorkInProgressReceivedUpdate();
              }
              hook.memoizedState = newState;
              if (hook.baseQueue === null) {
                hook.baseState = newState;
              }
              queue.lastRenderedState = newState;
            }
            return [newState, dispatch];
          }
          function readFromUnsubcribedMutableSource(root2, source, getSnapshot) {
            {
              warnAboutMultipleRenderersDEV(source);
            }
            var getVersion = source._getVersion;
            var version = getVersion(source._source);
            var isSafeToReadFromSource = false;
            var currentRenderVersion = getWorkInProgressVersion(source);
            if (currentRenderVersion !== null) {
              isSafeToReadFromSource = currentRenderVersion === version;
            } else {
              isSafeToReadFromSource = isSubsetOfLanes(renderLanes, root2.mutableReadLanes);
              if (isSafeToReadFromSource) {
                setWorkInProgressVersion(source, version);
              }
            }
            if (isSafeToReadFromSource) {
              var snapshot = getSnapshot(source._source);
              {
                if (typeof snapshot === "function") {
                  error("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing.");
                }
              }
              return snapshot;
            } else {
              markSourceAsDirty(source);
              {
                {
                  throw Error("Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.");
                }
              }
            }
          }
          function useMutableSource(hook, source, getSnapshot, subscribe) {
            var root2 = getWorkInProgressRoot();
            if (!(root2 !== null)) {
              {
                throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
              }
            }
            var getVersion = source._getVersion;
            var version = getVersion(source._source);
            var dispatcher = ReactCurrentDispatcher$1.current;
            var _dispatcher$useState = dispatcher.useState(function() {
              return readFromUnsubcribedMutableSource(root2, source, getSnapshot);
            }), currentSnapshot = _dispatcher$useState[0], setSnapshot = _dispatcher$useState[1];
            var snapshot = currentSnapshot;
            var stateHook = workInProgressHook;
            var memoizedState = hook.memoizedState;
            var refs = memoizedState.refs;
            var prevGetSnapshot = refs.getSnapshot;
            var prevSource = memoizedState.source;
            var prevSubscribe = memoizedState.subscribe;
            var fiber = currentlyRenderingFiber$1;
            hook.memoizedState = {
              refs,
              source,
              subscribe
            };
            dispatcher.useEffect(function() {
              refs.getSnapshot = getSnapshot;
              refs.setSnapshot = setSnapshot;
              var maybeNewVersion = getVersion(source._source);
              if (!objectIs(version, maybeNewVersion)) {
                var maybeNewSnapshot = getSnapshot(source._source);
                {
                  if (typeof maybeNewSnapshot === "function") {
                    error("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing.");
                  }
                }
                if (!objectIs(snapshot, maybeNewSnapshot)) {
                  setSnapshot(maybeNewSnapshot);
                  var lane = requestUpdateLane(fiber);
                  markRootMutableRead(root2, lane);
                }
                markRootEntangled(root2, root2.mutableReadLanes);
              }
            }, [getSnapshot, source, subscribe]);
            dispatcher.useEffect(function() {
              var handleChange = function() {
                var latestGetSnapshot = refs.getSnapshot;
                var latestSetSnapshot = refs.setSnapshot;
                try {
                  latestSetSnapshot(latestGetSnapshot(source._source));
                  var lane = requestUpdateLane(fiber);
                  markRootMutableRead(root2, lane);
                } catch (error2) {
                  latestSetSnapshot(function() {
                    throw error2;
                  });
                }
              };
              var unsubscribe = subscribe(source._source, handleChange);
              {
                if (typeof unsubscribe !== "function") {
                  error("Mutable source subscribe function must return an unsubscribe function.");
                }
              }
              return unsubscribe;
            }, [source, subscribe]);
            if (!objectIs(prevGetSnapshot, getSnapshot) || !objectIs(prevSource, source) || !objectIs(prevSubscribe, subscribe)) {
              var newQueue = {
                pending: null,
                dispatch: null,
                lastRenderedReducer: basicStateReducer,
                lastRenderedState: snapshot
              };
              newQueue.dispatch = setSnapshot = dispatchAction.bind(null, currentlyRenderingFiber$1, newQueue);
              stateHook.queue = newQueue;
              stateHook.baseQueue = null;
              snapshot = readFromUnsubcribedMutableSource(root2, source, getSnapshot);
              stateHook.memoizedState = stateHook.baseState = snapshot;
            }
            return snapshot;
          }
          function mountMutableSource(source, getSnapshot, subscribe) {
            var hook = mountWorkInProgressHook();
            hook.memoizedState = {
              refs: {
                getSnapshot,
                setSnapshot: null
              },
              source,
              subscribe
            };
            return useMutableSource(hook, source, getSnapshot, subscribe);
          }
          function updateMutableSource(source, getSnapshot, subscribe) {
            var hook = updateWorkInProgressHook();
            return useMutableSource(hook, source, getSnapshot, subscribe);
          }
          function mountState(initialState) {
            var hook = mountWorkInProgressHook();
            if (typeof initialState === "function") {
              initialState = initialState();
            }
            hook.memoizedState = hook.baseState = initialState;
            var queue = hook.queue = {
              pending: null,
              dispatch: null,
              lastRenderedReducer: basicStateReducer,
              lastRenderedState: initialState
            };
            var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
            return [hook.memoizedState, dispatch];
          }
          function updateState(initialState) {
            return updateReducer(basicStateReducer);
          }
          function rerenderState(initialState) {
            return rerenderReducer(basicStateReducer);
          }
          function pushEffect(tag, create, destroy, deps) {
            var effect = {
              tag,
              create,
              destroy,
              deps,
              next: null
            };
            var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
            if (componentUpdateQueue === null) {
              componentUpdateQueue = createFunctionComponentUpdateQueue();
              currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
              componentUpdateQueue.lastEffect = effect.next = effect;
            } else {
              var lastEffect = componentUpdateQueue.lastEffect;
              if (lastEffect === null) {
                componentUpdateQueue.lastEffect = effect.next = effect;
              } else {
                var firstEffect = lastEffect.next;
                lastEffect.next = effect;
                effect.next = firstEffect;
                componentUpdateQueue.lastEffect = effect;
              }
            }
            return effect;
          }
          function mountRef(initialValue) {
            var hook = mountWorkInProgressHook();
            var ref = {
              current: initialValue
            };
            {
              Object.seal(ref);
            }
            hook.memoizedState = ref;
            return ref;
          }
          function updateRef(initialValue) {
            var hook = updateWorkInProgressHook();
            return hook.memoizedState;
          }
          function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
            var hook = mountWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            currentlyRenderingFiber$1.flags |= fiberFlags;
            hook.memoizedState = pushEffect(HasEffect | hookFlags, create, void 0, nextDeps);
          }
          function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
            var hook = updateWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var destroy = void 0;
            if (currentHook !== null) {
              var prevEffect = currentHook.memoizedState;
              destroy = prevEffect.destroy;
              if (nextDeps !== null) {
                var prevDeps = prevEffect.deps;
                if (areHookInputsEqual(nextDeps, prevDeps)) {
                  pushEffect(hookFlags, create, destroy, nextDeps);
                  return;
                }
              }
            }
            currentlyRenderingFiber$1.flags |= fiberFlags;
            hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);
          }
          function mountEffect(create, deps) {
            {
              if ("undefined" !== typeof jest) {
                warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
              }
            }
            return mountEffectImpl(Update | Passive, Passive$1, create, deps);
          }
          function updateEffect(create, deps) {
            {
              if ("undefined" !== typeof jest) {
                warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
              }
            }
            return updateEffectImpl(Update | Passive, Passive$1, create, deps);
          }
          function mountLayoutEffect(create, deps) {
            return mountEffectImpl(Update, Layout, create, deps);
          }
          function updateLayoutEffect(create, deps) {
            return updateEffectImpl(Update, Layout, create, deps);
          }
          function imperativeHandleEffect(create, ref) {
            if (typeof ref === "function") {
              var refCallback = ref;
              var _inst = create();
              refCallback(_inst);
              return function() {
                refCallback(null);
              };
            } else if (ref !== null && ref !== void 0) {
              var refObject = ref;
              {
                if (!refObject.hasOwnProperty("current")) {
                  error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(refObject).join(", ") + "}");
                }
              }
              var _inst2 = create();
              refObject.current = _inst2;
              return function() {
                refObject.current = null;
              };
            }
          }
          function mountImperativeHandle(ref, create, deps) {
            {
              if (typeof create !== "function") {
                error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
              }
            }
            var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
            return mountEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
          }
          function updateImperativeHandle(ref, create, deps) {
            {
              if (typeof create !== "function") {
                error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
              }
            }
            var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
            return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
          }
          function mountDebugValue(value, formatterFn) {
          }
          var updateDebugValue = mountDebugValue;
          function mountCallback(callback, deps) {
            var hook = mountWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            hook.memoizedState = [callback, nextDeps];
            return callback;
          }
          function updateCallback(callback, deps) {
            var hook = updateWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var prevState = hook.memoizedState;
            if (prevState !== null) {
              if (nextDeps !== null) {
                var prevDeps = prevState[1];
                if (areHookInputsEqual(nextDeps, prevDeps)) {
                  return prevState[0];
                }
              }
            }
            hook.memoizedState = [callback, nextDeps];
            return callback;
          }
          function mountMemo(nextCreate, deps) {
            var hook = mountWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var nextValue = nextCreate();
            hook.memoizedState = [nextValue, nextDeps];
            return nextValue;
          }
          function updateMemo(nextCreate, deps) {
            var hook = updateWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var prevState = hook.memoizedState;
            if (prevState !== null) {
              if (nextDeps !== null) {
                var prevDeps = prevState[1];
                if (areHookInputsEqual(nextDeps, prevDeps)) {
                  return prevState[0];
                }
              }
            }
            var nextValue = nextCreate();
            hook.memoizedState = [nextValue, nextDeps];
            return nextValue;
          }
          function mountDeferredValue(value) {
            var _mountState = mountState(value), prevValue = _mountState[0], setValue = _mountState[1];
            mountEffect(function() {
              var prevTransition = ReactCurrentBatchConfig$1.transition;
              ReactCurrentBatchConfig$1.transition = 1;
              try {
                setValue(value);
              } finally {
                ReactCurrentBatchConfig$1.transition = prevTransition;
              }
            }, [value]);
            return prevValue;
          }
          function updateDeferredValue(value) {
            var _updateState = updateState(), prevValue = _updateState[0], setValue = _updateState[1];
            updateEffect(function() {
              var prevTransition = ReactCurrentBatchConfig$1.transition;
              ReactCurrentBatchConfig$1.transition = 1;
              try {
                setValue(value);
              } finally {
                ReactCurrentBatchConfig$1.transition = prevTransition;
              }
            }, [value]);
            return prevValue;
          }
          function rerenderDeferredValue(value) {
            var _rerenderState = rerenderState(), prevValue = _rerenderState[0], setValue = _rerenderState[1];
            updateEffect(function() {
              var prevTransition = ReactCurrentBatchConfig$1.transition;
              ReactCurrentBatchConfig$1.transition = 1;
              try {
                setValue(value);
              } finally {
                ReactCurrentBatchConfig$1.transition = prevTransition;
              }
            }, [value]);
            return prevValue;
          }
          function startTransition(setPending, callback) {
            var priorityLevel = getCurrentPriorityLevel();
            {
              runWithPriority$1(priorityLevel < UserBlockingPriority$2 ? UserBlockingPriority$2 : priorityLevel, function() {
                setPending(true);
              });
              runWithPriority$1(priorityLevel > NormalPriority$1 ? NormalPriority$1 : priorityLevel, function() {
                var prevTransition = ReactCurrentBatchConfig$1.transition;
                ReactCurrentBatchConfig$1.transition = 1;
                try {
                  setPending(false);
                  callback();
                } finally {
                  ReactCurrentBatchConfig$1.transition = prevTransition;
                }
              });
            }
          }
          function mountTransition() {
            var _mountState2 = mountState(false), isPending = _mountState2[0], setPending = _mountState2[1];
            var start = startTransition.bind(null, setPending);
            mountRef(start);
            return [start, isPending];
          }
          function updateTransition() {
            var _updateState2 = updateState(), isPending = _updateState2[0];
            var startRef = updateRef();
            var start = startRef.current;
            return [start, isPending];
          }
          function rerenderTransition() {
            var _rerenderState2 = rerenderState(), isPending = _rerenderState2[0];
            var startRef = updateRef();
            var start = startRef.current;
            return [start, isPending];
          }
          var isUpdatingOpaqueValueInRenderPhase = false;
          function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
            {
              return isUpdatingOpaqueValueInRenderPhase;
            }
          }
          function warnOnOpaqueIdentifierAccessInDEV(fiber) {
            {
              var name = getComponentName(fiber.type) || "Unknown";
              if (getIsRendering() && !didWarnAboutUseOpaqueIdentifier[name]) {
                error("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.");
                didWarnAboutUseOpaqueIdentifier[name] = true;
              }
            }
          }
          function mountOpaqueIdentifier() {
            var makeId = makeClientIdInDEV.bind(null, warnOnOpaqueIdentifierAccessInDEV.bind(null, currentlyRenderingFiber$1));
            if (getIsHydrating()) {
              var didUpgrade = false;
              var fiber = currentlyRenderingFiber$1;
              var readValue = function() {
                if (!didUpgrade) {
                  didUpgrade = true;
                  {
                    isUpdatingOpaqueValueInRenderPhase = true;
                    setId(makeId());
                    isUpdatingOpaqueValueInRenderPhase = false;
                    warnOnOpaqueIdentifierAccessInDEV(fiber);
                  }
                }
                {
                  {
                    throw Error("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.");
                  }
                }
              };
              var id = makeOpaqueHydratingObject(readValue);
              var setId = mountState(id)[1];
              if ((currentlyRenderingFiber$1.mode & BlockingMode) === NoMode) {
                currentlyRenderingFiber$1.flags |= Update | Passive;
                pushEffect(HasEffect | Passive$1, function() {
                  setId(makeId());
                }, void 0, null);
              }
              return id;
            } else {
              var _id = makeId();
              mountState(_id);
              return _id;
            }
          }
          function updateOpaqueIdentifier() {
            var id = updateState()[0];
            return id;
          }
          function rerenderOpaqueIdentifier() {
            var id = rerenderState()[0];
            return id;
          }
          function dispatchAction(fiber, queue, action) {
            {
              if (typeof arguments[3] === "function") {
                error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
              }
            }
            var eventTime = requestEventTime();
            var lane = requestUpdateLane(fiber);
            var update = {
              lane,
              action,
              eagerReducer: null,
              eagerState: null,
              next: null
            };
            var pending = queue.pending;
            if (pending === null) {
              update.next = update;
            } else {
              update.next = pending.next;
              pending.next = update;
            }
            queue.pending = update;
            var alternate = fiber.alternate;
            if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
              didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
            } else {
              if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {
                var lastRenderedReducer = queue.lastRenderedReducer;
                if (lastRenderedReducer !== null) {
                  var prevDispatcher;
                  {
                    prevDispatcher = ReactCurrentDispatcher$1.current;
                    ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                  }
                  try {
                    var currentState = queue.lastRenderedState;
                    var eagerState = lastRenderedReducer(currentState, action);
                    update.eagerReducer = lastRenderedReducer;
                    update.eagerState = eagerState;
                    if (objectIs(eagerState, currentState)) {
                      return;
                    }
                  } catch (error2) {
                  } finally {
                    {
                      ReactCurrentDispatcher$1.current = prevDispatcher;
                    }
                  }
                }
              }
              {
                if ("undefined" !== typeof jest) {
                  warnIfNotScopedWithMatchingAct(fiber);
                  warnIfNotCurrentlyActingUpdatesInDev(fiber);
                }
              }
              scheduleUpdateOnFiber(fiber, lane, eventTime);
            }
          }
          var ContextOnlyDispatcher = {
            readContext,
            useCallback: throwInvalidHookError,
            useContext: throwInvalidHookError,
            useEffect: throwInvalidHookError,
            useImperativeHandle: throwInvalidHookError,
            useLayoutEffect: throwInvalidHookError,
            useMemo: throwInvalidHookError,
            useReducer: throwInvalidHookError,
            useRef: throwInvalidHookError,
            useState: throwInvalidHookError,
            useDebugValue: throwInvalidHookError,
            useDeferredValue: throwInvalidHookError,
            useTransition: throwInvalidHookError,
            useMutableSource: throwInvalidHookError,
            useOpaqueIdentifier: throwInvalidHookError,
            unstable_isNewReconciler: enableNewReconciler
          };
          var HooksDispatcherOnMountInDEV = null;
          var HooksDispatcherOnMountWithHookTypesInDEV = null;
          var HooksDispatcherOnUpdateInDEV = null;
          var HooksDispatcherOnRerenderInDEV = null;
          var InvalidNestedHooksDispatcherOnMountInDEV = null;
          var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
          var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
          {
            var warnInvalidContextAccess = function() {
              error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
            };
            var warnInvalidHookAccess = function() {
              error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks");
            };
            HooksDispatcherOnMountInDEV = {
              readContext: function(context, observedBits) {
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                mountHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                mountHookTypesDev();
                return mountRef(initialValue);
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                mountHookTypesDev();
                return mountDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                mountHookTypesDev();
                return mountDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                mountHookTypesDev();
                return mountTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                mountHookTypesDev();
                return mountMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                mountHookTypesDev();
                return mountOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            HooksDispatcherOnMountWithHookTypesInDEV = {
              readContext: function(context, observedBits) {
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                updateHookTypesDev();
                return mountCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                updateHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                updateHookTypesDev();
                return mountEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                updateHookTypesDev();
                return mountImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                updateHookTypesDev();
                return mountLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                updateHookTypesDev();
                return mountRef(initialValue);
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                updateHookTypesDev();
                return mountDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                updateHookTypesDev();
                return mountDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                updateHookTypesDev();
                return mountTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                updateHookTypesDev();
                return mountMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                updateHookTypesDev();
                return mountOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            HooksDispatcherOnUpdateInDEV = {
              readContext: function(context, observedBits) {
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                updateHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                updateHookTypesDev();
                return updateDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                updateHookTypesDev();
                return updateTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                updateHookTypesDev();
                return updateMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                updateHookTypesDev();
                return updateOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            HooksDispatcherOnRerenderInDEV = {
              readContext: function(context, observedBits) {
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                updateHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
                try {
                  return rerenderReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
                try {
                  return rerenderState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                updateHookTypesDev();
                return rerenderDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                updateHookTypesDev();
                return rerenderTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                updateHookTypesDev();
                return updateMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                updateHookTypesDev();
                return rerenderOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            InvalidNestedHooksDispatcherOnMountInDEV = {
              readContext: function(context, observedBits) {
                warnInvalidContextAccess();
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                warnInvalidHookAccess();
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                warnInvalidHookAccess();
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountRef(initialValue);
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                warnInvalidHookAccess();
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            InvalidNestedHooksDispatcherOnUpdateInDEV = {
              readContext: function(context, observedBits) {
                warnInvalidContextAccess();
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            InvalidNestedHooksDispatcherOnRerenderInDEV = {
              readContext: function(context, observedBits) {
                warnInvalidContextAccess();
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return rerenderReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return rerenderState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return rerenderDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return rerenderTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return rerenderOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
          }
          var now$1 = Scheduler.unstable_now;
          var commitTime = 0;
          var profilerStartTime = -1;
          function getCommitTime() {
            return commitTime;
          }
          function recordCommitTime() {
            commitTime = now$1();
          }
          function startProfilerTimer(fiber) {
            profilerStartTime = now$1();
            if (fiber.actualStartTime < 0) {
              fiber.actualStartTime = now$1();
            }
          }
          function stopProfilerTimerIfRunning(fiber) {
            profilerStartTime = -1;
          }
          function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
            if (profilerStartTime >= 0) {
              var elapsedTime = now$1() - profilerStartTime;
              fiber.actualDuration += elapsedTime;
              if (overrideBaseTime) {
                fiber.selfBaseDuration = elapsedTime;
              }
              profilerStartTime = -1;
            }
          }
          function transferActualDuration(fiber) {
            var child = fiber.child;
            while (child) {
              fiber.actualDuration += child.actualDuration;
              child = child.sibling;
            }
          }
          var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
          var didReceiveUpdate = false;
          var didWarnAboutBadClass;
          var didWarnAboutModulePatternComponent;
          var didWarnAboutContextTypeOnFunctionComponent;
          var didWarnAboutGetDerivedStateOnFunctionComponent;
          var didWarnAboutFunctionRefs;
          var didWarnAboutReassigningProps;
          var didWarnAboutRevealOrder;
          var didWarnAboutTailOptions;
          {
            didWarnAboutBadClass = {};
            didWarnAboutModulePatternComponent = {};
            didWarnAboutContextTypeOnFunctionComponent = {};
            didWarnAboutGetDerivedStateOnFunctionComponent = {};
            didWarnAboutFunctionRefs = {};
            didWarnAboutReassigningProps = false;
            didWarnAboutRevealOrder = {};
            didWarnAboutTailOptions = {};
          }
          function reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2) {
            if (current2 === null) {
              workInProgress2.child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
            } else {
              workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, nextChildren, renderLanes2);
            }
          }
          function forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2) {
            workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
            workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
          }
          function updateForwardRef(current2, workInProgress2, Component2, nextProps, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var innerPropTypes = Component2.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    "prop",
                    getComponentName(Component2)
                  );
                }
              }
            }
            var render2 = Component2.render;
            var ref = workInProgress2.ref;
            var nextChildren;
            prepareToReadContext(workInProgress2, renderLanes2);
            {
              ReactCurrentOwner$1.current = workInProgress2;
              setIsRendering(true);
              nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
              if (workInProgress2.mode & StrictMode) {
                disableLogs();
                try {
                  nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
                } finally {
                  reenableLogs();
                }
              }
              setIsRendering(false);
            }
            if (current2 !== null && !didReceiveUpdate) {
              bailoutHooks(current2, workInProgress2, renderLanes2);
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            workInProgress2.flags |= PerformedWork;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateMemoComponent(current2, workInProgress2, Component2, nextProps, updateLanes, renderLanes2) {
            if (current2 === null) {
              var type = Component2.type;
              if (isSimpleFunctionComponent(type) && Component2.compare === null && Component2.defaultProps === void 0) {
                var resolvedType = type;
                {
                  resolvedType = resolveFunctionForHotReloading(type);
                }
                workInProgress2.tag = SimpleMemoComponent;
                workInProgress2.type = resolvedType;
                {
                  validateFunctionComponentInDev(workInProgress2, type);
                }
                return updateSimpleMemoComponent(current2, workInProgress2, resolvedType, nextProps, updateLanes, renderLanes2);
              }
              {
                var innerPropTypes = type.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    "prop",
                    getComponentName(type)
                  );
                }
              }
              var child = createFiberFromTypeAndProps(Component2.type, null, nextProps, workInProgress2, workInProgress2.mode, renderLanes2);
              child.ref = workInProgress2.ref;
              child.return = workInProgress2;
              workInProgress2.child = child;
              return child;
            }
            {
              var _type = Component2.type;
              var _innerPropTypes = _type.propTypes;
              if (_innerPropTypes) {
                checkPropTypes(
                  _innerPropTypes,
                  nextProps,
                  "prop",
                  getComponentName(_type)
                );
              }
            }
            var currentChild = current2.child;
            if (!includesSomeLane(updateLanes, renderLanes2)) {
              var prevProps = currentChild.memoizedProps;
              var compare = Component2.compare;
              compare = compare !== null ? compare : shallowEqual;
              if (compare(prevProps, nextProps) && current2.ref === workInProgress2.ref) {
                return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
              }
            }
            workInProgress2.flags |= PerformedWork;
            var newChild = createWorkInProgress(currentChild, nextProps);
            newChild.ref = workInProgress2.ref;
            newChild.return = workInProgress2;
            workInProgress2.child = newChild;
            return newChild;
          }
          function updateSimpleMemoComponent(current2, workInProgress2, Component2, nextProps, updateLanes, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var outerMemoType = workInProgress2.elementType;
                if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
                  var lazyComponent = outerMemoType;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    outerMemoType = init(payload);
                  } catch (x) {
                    outerMemoType = null;
                  }
                  var outerPropTypes = outerMemoType && outerMemoType.propTypes;
                  if (outerPropTypes) {
                    checkPropTypes(
                      outerPropTypes,
                      nextProps,
                      "prop",
                      getComponentName(outerMemoType)
                    );
                  }
                }
              }
            }
            if (current2 !== null) {
              var prevProps = current2.memoizedProps;
              if (shallowEqual(prevProps, nextProps) && current2.ref === workInProgress2.ref && workInProgress2.type === current2.type) {
                didReceiveUpdate = false;
                if (!includesSomeLane(renderLanes2, updateLanes)) {
                  workInProgress2.lanes = current2.lanes;
                  return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                } else if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
                  didReceiveUpdate = true;
                }
              }
            }
            return updateFunctionComponent(current2, workInProgress2, Component2, nextProps, renderLanes2);
          }
          function updateOffscreenComponent(current2, workInProgress2, renderLanes2) {
            var nextProps = workInProgress2.pendingProps;
            var nextChildren = nextProps.children;
            var prevState = current2 !== null ? current2.memoizedState : null;
            if (nextProps.mode === "hidden" || nextProps.mode === "unstable-defer-without-hiding") {
              if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
                var nextState = {
                  baseLanes: NoLanes
                };
                workInProgress2.memoizedState = nextState;
                pushRenderLanes(workInProgress2, renderLanes2);
              } else if (!includesSomeLane(renderLanes2, OffscreenLane)) {
                var nextBaseLanes;
                if (prevState !== null) {
                  var prevBaseLanes = prevState.baseLanes;
                  nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes2);
                } else {
                  nextBaseLanes = renderLanes2;
                }
                {
                  markSpawnedWork(OffscreenLane);
                }
                workInProgress2.lanes = workInProgress2.childLanes = laneToLanes(OffscreenLane);
                var _nextState = {
                  baseLanes: nextBaseLanes
                };
                workInProgress2.memoizedState = _nextState;
                pushRenderLanes(workInProgress2, nextBaseLanes);
                return null;
              } else {
                var _nextState2 = {
                  baseLanes: NoLanes
                };
                workInProgress2.memoizedState = _nextState2;
                var subtreeRenderLanes2 = prevState !== null ? prevState.baseLanes : renderLanes2;
                pushRenderLanes(workInProgress2, subtreeRenderLanes2);
              }
            } else {
              var _subtreeRenderLanes;
              if (prevState !== null) {
                _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes2);
                workInProgress2.memoizedState = null;
              } else {
                _subtreeRenderLanes = renderLanes2;
              }
              pushRenderLanes(workInProgress2, _subtreeRenderLanes);
            }
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          var updateLegacyHiddenComponent = updateOffscreenComponent;
          function updateFragment(current2, workInProgress2, renderLanes2) {
            var nextChildren = workInProgress2.pendingProps;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateMode(current2, workInProgress2, renderLanes2) {
            var nextChildren = workInProgress2.pendingProps.children;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateProfiler(current2, workInProgress2, renderLanes2) {
            {
              workInProgress2.flags |= Update;
              var stateNode = workInProgress2.stateNode;
              stateNode.effectDuration = 0;
              stateNode.passiveEffectDuration = 0;
            }
            var nextProps = workInProgress2.pendingProps;
            var nextChildren = nextProps.children;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function markRef(current2, workInProgress2) {
            var ref = workInProgress2.ref;
            if (current2 === null && ref !== null || current2 !== null && current2.ref !== ref) {
              workInProgress2.flags |= Ref;
            }
          }
          function updateFunctionComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var innerPropTypes = Component2.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    "prop",
                    getComponentName(Component2)
                  );
                }
              }
            }
            var context;
            {
              var unmaskedContext = getUnmaskedContext(workInProgress2, Component2, true);
              context = getMaskedContext(workInProgress2, unmaskedContext);
            }
            var nextChildren;
            prepareToReadContext(workInProgress2, renderLanes2);
            {
              ReactCurrentOwner$1.current = workInProgress2;
              setIsRendering(true);
              nextChildren = renderWithHooks(current2, workInProgress2, Component2, nextProps, context, renderLanes2);
              if (workInProgress2.mode & StrictMode) {
                disableLogs();
                try {
                  nextChildren = renderWithHooks(current2, workInProgress2, Component2, nextProps, context, renderLanes2);
                } finally {
                  reenableLogs();
                }
              }
              setIsRendering(false);
            }
            if (current2 !== null && !didReceiveUpdate) {
              bailoutHooks(current2, workInProgress2, renderLanes2);
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            workInProgress2.flags |= PerformedWork;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateClassComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var innerPropTypes = Component2.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    "prop",
                    getComponentName(Component2)
                  );
                }
              }
            }
            var hasContext;
            if (isContextProvider(Component2)) {
              hasContext = true;
              pushContextProvider(workInProgress2);
            } else {
              hasContext = false;
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            var instance = workInProgress2.stateNode;
            var shouldUpdate;
            if (instance === null) {
              if (current2 !== null) {
                current2.alternate = null;
                workInProgress2.alternate = null;
                workInProgress2.flags |= Placement;
              }
              constructClassInstance(workInProgress2, Component2, nextProps);
              mountClassInstance(workInProgress2, Component2, nextProps, renderLanes2);
              shouldUpdate = true;
            } else if (current2 === null) {
              shouldUpdate = resumeMountClassInstance(workInProgress2, Component2, nextProps, renderLanes2);
            } else {
              shouldUpdate = updateClassInstance(current2, workInProgress2, Component2, nextProps, renderLanes2);
            }
            var nextUnitOfWork = finishClassComponent(current2, workInProgress2, Component2, shouldUpdate, hasContext, renderLanes2);
            {
              var inst = workInProgress2.stateNode;
              if (shouldUpdate && inst.props !== nextProps) {
                if (!didWarnAboutReassigningProps) {
                  error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", getComponentName(workInProgress2.type) || "a component");
                }
                didWarnAboutReassigningProps = true;
              }
            }
            return nextUnitOfWork;
          }
          function finishClassComponent(current2, workInProgress2, Component2, shouldUpdate, hasContext, renderLanes2) {
            markRef(current2, workInProgress2);
            var didCaptureError = (workInProgress2.flags & DidCapture) !== NoFlags;
            if (!shouldUpdate && !didCaptureError) {
              if (hasContext) {
                invalidateContextProvider(workInProgress2, Component2, false);
              }
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            var instance = workInProgress2.stateNode;
            ReactCurrentOwner$1.current = workInProgress2;
            var nextChildren;
            if (didCaptureError && typeof Component2.getDerivedStateFromError !== "function") {
              nextChildren = null;
              {
                stopProfilerTimerIfRunning();
              }
            } else {
              {
                setIsRendering(true);
                nextChildren = instance.render();
                if (workInProgress2.mode & StrictMode) {
                  disableLogs();
                  try {
                    instance.render();
                  } finally {
                    reenableLogs();
                  }
                }
                setIsRendering(false);
              }
            }
            workInProgress2.flags |= PerformedWork;
            if (current2 !== null && didCaptureError) {
              forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2);
            } else {
              reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            }
            workInProgress2.memoizedState = instance.state;
            if (hasContext) {
              invalidateContextProvider(workInProgress2, Component2, true);
            }
            return workInProgress2.child;
          }
          function pushHostRootContext(workInProgress2) {
            var root2 = workInProgress2.stateNode;
            if (root2.pendingContext) {
              pushTopLevelContextObject(workInProgress2, root2.pendingContext, root2.pendingContext !== root2.context);
            } else if (root2.context) {
              pushTopLevelContextObject(workInProgress2, root2.context, false);
            }
            pushHostContainer(workInProgress2, root2.containerInfo);
          }
          function updateHostRoot(current2, workInProgress2, renderLanes2) {
            pushHostRootContext(workInProgress2);
            var updateQueue = workInProgress2.updateQueue;
            if (!(current2 !== null && updateQueue !== null)) {
              {
                throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            var nextProps = workInProgress2.pendingProps;
            var prevState = workInProgress2.memoizedState;
            var prevChildren = prevState !== null ? prevState.element : null;
            cloneUpdateQueue(current2, workInProgress2);
            processUpdateQueue(workInProgress2, nextProps, null, renderLanes2);
            var nextState = workInProgress2.memoizedState;
            var nextChildren = nextState.element;
            if (nextChildren === prevChildren) {
              resetHydrationState();
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            var root2 = workInProgress2.stateNode;
            if (root2.hydrate && enterHydrationState(workInProgress2)) {
              {
                var mutableSourceEagerHydrationData = root2.mutableSourceEagerHydrationData;
                if (mutableSourceEagerHydrationData != null) {
                  for (var i = 0; i < mutableSourceEagerHydrationData.length; i += 2) {
                    var mutableSource = mutableSourceEagerHydrationData[i];
                    var version = mutableSourceEagerHydrationData[i + 1];
                    setWorkInProgressVersion(mutableSource, version);
                  }
                }
              }
              var child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
              workInProgress2.child = child;
              var node = child;
              while (node) {
                node.flags = node.flags & ~Placement | Hydrating;
                node = node.sibling;
              }
            } else {
              reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
              resetHydrationState();
            }
            return workInProgress2.child;
          }
          function updateHostComponent(current2, workInProgress2, renderLanes2) {
            pushHostContext(workInProgress2);
            if (current2 === null) {
              tryToClaimNextHydratableInstance(workInProgress2);
            }
            var type = workInProgress2.type;
            var nextProps = workInProgress2.pendingProps;
            var prevProps = current2 !== null ? current2.memoizedProps : null;
            var nextChildren = nextProps.children;
            var isDirectTextChild = shouldSetTextContent(type, nextProps);
            if (isDirectTextChild) {
              nextChildren = null;
            } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
              workInProgress2.flags |= ContentReset;
            }
            markRef(current2, workInProgress2);
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateHostText(current2, workInProgress2) {
            if (current2 === null) {
              tryToClaimNextHydratableInstance(workInProgress2);
            }
            return null;
          }
          function mountLazyComponent(_current, workInProgress2, elementType, updateLanes, renderLanes2) {
            if (_current !== null) {
              _current.alternate = null;
              workInProgress2.alternate = null;
              workInProgress2.flags |= Placement;
            }
            var props = workInProgress2.pendingProps;
            var lazyComponent = elementType;
            var payload = lazyComponent._payload;
            var init = lazyComponent._init;
            var Component2 = init(payload);
            workInProgress2.type = Component2;
            var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component2);
            var resolvedProps = resolveDefaultProps(Component2, props);
            var child;
            switch (resolvedTag) {
              case FunctionComponent: {
                {
                  validateFunctionComponentInDev(workInProgress2, Component2);
                  workInProgress2.type = Component2 = resolveFunctionForHotReloading(Component2);
                }
                child = updateFunctionComponent(null, workInProgress2, Component2, resolvedProps, renderLanes2);
                return child;
              }
              case ClassComponent: {
                {
                  workInProgress2.type = Component2 = resolveClassForHotReloading(Component2);
                }
                child = updateClassComponent(null, workInProgress2, Component2, resolvedProps, renderLanes2);
                return child;
              }
              case ForwardRef: {
                {
                  workInProgress2.type = Component2 = resolveForwardRefForHotReloading(Component2);
                }
                child = updateForwardRef(null, workInProgress2, Component2, resolvedProps, renderLanes2);
                return child;
              }
              case MemoComponent: {
                {
                  if (workInProgress2.type !== workInProgress2.elementType) {
                    var outerPropTypes = Component2.propTypes;
                    if (outerPropTypes) {
                      checkPropTypes(
                        outerPropTypes,
                        resolvedProps,
                        "prop",
                        getComponentName(Component2)
                      );
                    }
                  }
                }
                child = updateMemoComponent(
                  null,
                  workInProgress2,
                  Component2,
                  resolveDefaultProps(Component2.type, resolvedProps),
                  updateLanes,
                  renderLanes2
                );
                return child;
              }
            }
            var hint = "";
            {
              if (Component2 !== null && typeof Component2 === "object" && Component2.$$typeof === REACT_LAZY_TYPE) {
                hint = " Did you wrap a component in React.lazy() more than once?";
              }
            }
            {
              {
                throw Error("Element type is invalid. Received a promise that resolves to: " + Component2 + ". Lazy element type must resolve to a class or function." + hint);
              }
            }
          }
          function mountIncompleteClassComponent(_current, workInProgress2, Component2, nextProps, renderLanes2) {
            if (_current !== null) {
              _current.alternate = null;
              workInProgress2.alternate = null;
              workInProgress2.flags |= Placement;
            }
            workInProgress2.tag = ClassComponent;
            var hasContext;
            if (isContextProvider(Component2)) {
              hasContext = true;
              pushContextProvider(workInProgress2);
            } else {
              hasContext = false;
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            constructClassInstance(workInProgress2, Component2, nextProps);
            mountClassInstance(workInProgress2, Component2, nextProps, renderLanes2);
            return finishClassComponent(null, workInProgress2, Component2, true, hasContext, renderLanes2);
          }
          function mountIndeterminateComponent(_current, workInProgress2, Component2, renderLanes2) {
            if (_current !== null) {
              _current.alternate = null;
              workInProgress2.alternate = null;
              workInProgress2.flags |= Placement;
            }
            var props = workInProgress2.pendingProps;
            var context;
            {
              var unmaskedContext = getUnmaskedContext(workInProgress2, Component2, false);
              context = getMaskedContext(workInProgress2, unmaskedContext);
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            var value;
            {
              if (Component2.prototype && typeof Component2.prototype.render === "function") {
                var componentName = getComponentName(Component2) || "Unknown";
                if (!didWarnAboutBadClass[componentName]) {
                  error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", componentName, componentName);
                  didWarnAboutBadClass[componentName] = true;
                }
              }
              if (workInProgress2.mode & StrictMode) {
                ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, null);
              }
              setIsRendering(true);
              ReactCurrentOwner$1.current = workInProgress2;
              value = renderWithHooks(null, workInProgress2, Component2, props, context, renderLanes2);
              setIsRendering(false);
            }
            workInProgress2.flags |= PerformedWork;
            {
              if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
                var _componentName = getComponentName(Component2) || "Unknown";
                if (!didWarnAboutModulePatternComponent[_componentName]) {
                  error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName, _componentName, _componentName);
                  didWarnAboutModulePatternComponent[_componentName] = true;
                }
              }
            }
            if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
              {
                var _componentName2 = getComponentName(Component2) || "Unknown";
                if (!didWarnAboutModulePatternComponent[_componentName2]) {
                  error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName2, _componentName2, _componentName2);
                  didWarnAboutModulePatternComponent[_componentName2] = true;
                }
              }
              workInProgress2.tag = ClassComponent;
              workInProgress2.memoizedState = null;
              workInProgress2.updateQueue = null;
              var hasContext = false;
              if (isContextProvider(Component2)) {
                hasContext = true;
                pushContextProvider(workInProgress2);
              } else {
                hasContext = false;
              }
              workInProgress2.memoizedState = value.state !== null && value.state !== void 0 ? value.state : null;
              initializeUpdateQueue(workInProgress2);
              var getDerivedStateFromProps = Component2.getDerivedStateFromProps;
              if (typeof getDerivedStateFromProps === "function") {
                applyDerivedStateFromProps(workInProgress2, Component2, getDerivedStateFromProps, props);
              }
              adoptClassInstance(workInProgress2, value);
              mountClassInstance(workInProgress2, Component2, props, renderLanes2);
              return finishClassComponent(null, workInProgress2, Component2, true, hasContext, renderLanes2);
            } else {
              workInProgress2.tag = FunctionComponent;
              {
                if (workInProgress2.mode & StrictMode) {
                  disableLogs();
                  try {
                    value = renderWithHooks(null, workInProgress2, Component2, props, context, renderLanes2);
                  } finally {
                    reenableLogs();
                  }
                }
              }
              reconcileChildren(null, workInProgress2, value, renderLanes2);
              {
                validateFunctionComponentInDev(workInProgress2, Component2);
              }
              return workInProgress2.child;
            }
          }
          function validateFunctionComponentInDev(workInProgress2, Component2) {
            {
              if (Component2) {
                if (Component2.childContextTypes) {
                  error("%s(...): childContextTypes cannot be defined on a function component.", Component2.displayName || Component2.name || "Component");
                }
              }
              if (workInProgress2.ref !== null) {
                var info = "";
                var ownerName = getCurrentFiberOwnerNameInDevOrNull();
                if (ownerName) {
                  info += "\n\nCheck the render method of `" + ownerName + "`.";
                }
                var warningKey = ownerName || workInProgress2._debugID || "";
                var debugSource = workInProgress2._debugSource;
                if (debugSource) {
                  warningKey = debugSource.fileName + ":" + debugSource.lineNumber;
                }
                if (!didWarnAboutFunctionRefs[warningKey]) {
                  didWarnAboutFunctionRefs[warningKey] = true;
                  error("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", info);
                }
              }
              if (typeof Component2.getDerivedStateFromProps === "function") {
                var _componentName3 = getComponentName(Component2) || "Unknown";
                if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {
                  error("%s: Function components do not support getDerivedStateFromProps.", _componentName3);
                  didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;
                }
              }
              if (typeof Component2.contextType === "object" && Component2.contextType !== null) {
                var _componentName4 = getComponentName(Component2) || "Unknown";
                if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
                  error("%s: Function components do not support contextType.", _componentName4);
                  didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
                }
              }
            }
          }
          var SUSPENDED_MARKER = {
            dehydrated: null,
            retryLane: NoLane
          };
          function mountSuspenseOffscreenState(renderLanes2) {
            return {
              baseLanes: renderLanes2
            };
          }
          function updateSuspenseOffscreenState(prevOffscreenState, renderLanes2) {
            return {
              baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes2)
            };
          }
          function shouldRemainOnFallback(suspenseContext, current2, workInProgress2, renderLanes2) {
            if (current2 !== null) {
              var suspenseState = current2.memoizedState;
              if (suspenseState === null) {
                return false;
              }
            }
            return hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
          }
          function getRemainingWorkInPrimaryTree(current2, renderLanes2) {
            return removeLanes(current2.childLanes, renderLanes2);
          }
          function updateSuspenseComponent(current2, workInProgress2, renderLanes2) {
            var nextProps = workInProgress2.pendingProps;
            {
              if (shouldSuspend(workInProgress2)) {
                workInProgress2.flags |= DidCapture;
              }
            }
            var suspenseContext = suspenseStackCursor.current;
            var showFallback = false;
            var didSuspend = (workInProgress2.flags & DidCapture) !== NoFlags;
            if (didSuspend || shouldRemainOnFallback(suspenseContext, current2)) {
              showFallback = true;
              workInProgress2.flags &= ~DidCapture;
            } else {
              if (current2 === null || current2.memoizedState !== null) {
                if (nextProps.fallback !== void 0 && nextProps.unstable_avoidThisFallback !== true) {
                  suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
                }
              }
            }
            suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
            pushSuspenseContext(workInProgress2, suspenseContext);
            if (current2 === null) {
              if (nextProps.fallback !== void 0) {
                tryToClaimNextHydratableInstance(workInProgress2);
              }
              var nextPrimaryChildren = nextProps.children;
              var nextFallbackChildren = nextProps.fallback;
              if (showFallback) {
                var fallbackFragment = mountSuspenseFallbackChildren(workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
                var primaryChildFragment = workInProgress2.child;
                primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes2);
                workInProgress2.memoizedState = SUSPENDED_MARKER;
                return fallbackFragment;
              } else if (typeof nextProps.unstable_expectedLoadTime === "number") {
                var _fallbackFragment = mountSuspenseFallbackChildren(workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
                var _primaryChildFragment = workInProgress2.child;
                _primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes2);
                workInProgress2.memoizedState = SUSPENDED_MARKER;
                workInProgress2.lanes = SomeRetryLane;
                {
                  markSpawnedWork(SomeRetryLane);
                }
                return _fallbackFragment;
              } else {
                return mountSuspensePrimaryChildren(workInProgress2, nextPrimaryChildren, renderLanes2);
              }
            } else {
              var prevState = current2.memoizedState;
              if (prevState !== null) {
                if (showFallback) {
                  var _nextFallbackChildren2 = nextProps.fallback;
                  var _nextPrimaryChildren2 = nextProps.children;
                  var _fallbackChildFragment = updateSuspenseFallbackChildren(current2, workInProgress2, _nextPrimaryChildren2, _nextFallbackChildren2, renderLanes2);
                  var _primaryChildFragment3 = workInProgress2.child;
                  var prevOffscreenState = current2.child.memoizedState;
                  _primaryChildFragment3.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes2) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes2);
                  _primaryChildFragment3.childLanes = getRemainingWorkInPrimaryTree(current2, renderLanes2);
                  workInProgress2.memoizedState = SUSPENDED_MARKER;
                  return _fallbackChildFragment;
                } else {
                  var _nextPrimaryChildren3 = nextProps.children;
                  var _primaryChildFragment4 = updateSuspensePrimaryChildren(current2, workInProgress2, _nextPrimaryChildren3, renderLanes2);
                  workInProgress2.memoizedState = null;
                  return _primaryChildFragment4;
                }
              } else {
                if (showFallback) {
                  var _nextFallbackChildren3 = nextProps.fallback;
                  var _nextPrimaryChildren4 = nextProps.children;
                  var _fallbackChildFragment2 = updateSuspenseFallbackChildren(current2, workInProgress2, _nextPrimaryChildren4, _nextFallbackChildren3, renderLanes2);
                  var _primaryChildFragment5 = workInProgress2.child;
                  var _prevOffscreenState = current2.child.memoizedState;
                  _primaryChildFragment5.memoizedState = _prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes2) : updateSuspenseOffscreenState(_prevOffscreenState, renderLanes2);
                  _primaryChildFragment5.childLanes = getRemainingWorkInPrimaryTree(current2, renderLanes2);
                  workInProgress2.memoizedState = SUSPENDED_MARKER;
                  return _fallbackChildFragment2;
                } else {
                  var _nextPrimaryChildren5 = nextProps.children;
                  var _primaryChildFragment6 = updateSuspensePrimaryChildren(current2, workInProgress2, _nextPrimaryChildren5, renderLanes2);
                  workInProgress2.memoizedState = null;
                  return _primaryChildFragment6;
                }
              }
            }
          }
          function mountSuspensePrimaryChildren(workInProgress2, primaryChildren, renderLanes2) {
            var mode = workInProgress2.mode;
            var primaryChildProps = {
              mode: "visible",
              children: primaryChildren
            };
            var primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, renderLanes2, null);
            primaryChildFragment.return = workInProgress2;
            workInProgress2.child = primaryChildFragment;
            return primaryChildFragment;
          }
          function mountSuspenseFallbackChildren(workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
            var mode = workInProgress2.mode;
            var progressedPrimaryFragment = workInProgress2.child;
            var primaryChildProps = {
              mode: "hidden",
              children: primaryChildren
            };
            var primaryChildFragment;
            var fallbackChildFragment;
            if ((mode & BlockingMode) === NoMode && progressedPrimaryFragment !== null) {
              primaryChildFragment = progressedPrimaryFragment;
              primaryChildFragment.childLanes = NoLanes;
              primaryChildFragment.pendingProps = primaryChildProps;
              if (workInProgress2.mode & ProfileMode) {
                primaryChildFragment.actualDuration = 0;
                primaryChildFragment.actualStartTime = -1;
                primaryChildFragment.selfBaseDuration = 0;
                primaryChildFragment.treeBaseDuration = 0;
              }
              fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
            } else {
              primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, NoLanes, null);
              fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
            }
            primaryChildFragment.return = workInProgress2;
            fallbackChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = fallbackChildFragment;
            workInProgress2.child = primaryChildFragment;
            return fallbackChildFragment;
          }
          function createWorkInProgressOffscreenFiber(current2, offscreenProps) {
            return createWorkInProgress(current2, offscreenProps);
          }
          function updateSuspensePrimaryChildren(current2, workInProgress2, primaryChildren, renderLanes2) {
            var currentPrimaryChildFragment = current2.child;
            var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
            var primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {
              mode: "visible",
              children: primaryChildren
            });
            if ((workInProgress2.mode & BlockingMode) === NoMode) {
              primaryChildFragment.lanes = renderLanes2;
            }
            primaryChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = null;
            if (currentFallbackChildFragment !== null) {
              currentFallbackChildFragment.nextEffect = null;
              currentFallbackChildFragment.flags = Deletion;
              workInProgress2.firstEffect = workInProgress2.lastEffect = currentFallbackChildFragment;
            }
            workInProgress2.child = primaryChildFragment;
            return primaryChildFragment;
          }
          function updateSuspenseFallbackChildren(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
            var mode = workInProgress2.mode;
            var currentPrimaryChildFragment = current2.child;
            var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
            var primaryChildProps = {
              mode: "hidden",
              children: primaryChildren
            };
            var primaryChildFragment;
            if ((mode & BlockingMode) === NoMode && workInProgress2.child !== currentPrimaryChildFragment) {
              var progressedPrimaryFragment = workInProgress2.child;
              primaryChildFragment = progressedPrimaryFragment;
              primaryChildFragment.childLanes = NoLanes;
              primaryChildFragment.pendingProps = primaryChildProps;
              if (workInProgress2.mode & ProfileMode) {
                primaryChildFragment.actualDuration = 0;
                primaryChildFragment.actualStartTime = -1;
                primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration;
                primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration;
              }
              var progressedLastEffect = primaryChildFragment.lastEffect;
              if (progressedLastEffect !== null) {
                workInProgress2.firstEffect = primaryChildFragment.firstEffect;
                workInProgress2.lastEffect = progressedLastEffect;
                progressedLastEffect.nextEffect = null;
              } else {
                workInProgress2.firstEffect = workInProgress2.lastEffect = null;
              }
            } else {
              primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);
            }
            var fallbackChildFragment;
            if (currentFallbackChildFragment !== null) {
              fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren);
            } else {
              fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
              fallbackChildFragment.flags |= Placement;
            }
            fallbackChildFragment.return = workInProgress2;
            primaryChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = fallbackChildFragment;
            workInProgress2.child = primaryChildFragment;
            return fallbackChildFragment;
          }
          function scheduleWorkOnFiber(fiber, renderLanes2) {
            fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
            var alternate = fiber.alternate;
            if (alternate !== null) {
              alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
            }
            scheduleWorkOnParentPath(fiber.return, renderLanes2);
          }
          function propagateSuspenseContextChange(workInProgress2, firstChild, renderLanes2) {
            var node = firstChild;
            while (node !== null) {
              if (node.tag === SuspenseComponent) {
                var state = node.memoizedState;
                if (state !== null) {
                  scheduleWorkOnFiber(node, renderLanes2);
                }
              } else if (node.tag === SuspenseListComponent) {
                scheduleWorkOnFiber(node, renderLanes2);
              } else if (node.child !== null) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === workInProgress2) {
                return;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === workInProgress2) {
                  return;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
          }
          function findLastContentRow(firstChild) {
            var row = firstChild;
            var lastContentRow = null;
            while (row !== null) {
              var currentRow = row.alternate;
              if (currentRow !== null && findFirstSuspended(currentRow) === null) {
                lastContentRow = row;
              }
              row = row.sibling;
            }
            return lastContentRow;
          }
          function validateRevealOrder(revealOrder) {
            {
              if (revealOrder !== void 0 && revealOrder !== "forwards" && revealOrder !== "backwards" && revealOrder !== "together" && !didWarnAboutRevealOrder[revealOrder]) {
                didWarnAboutRevealOrder[revealOrder] = true;
                if (typeof revealOrder === "string") {
                  switch (revealOrder.toLowerCase()) {
                    case "together":
                    case "forwards":
                    case "backwards": {
                      error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());
                      break;
                    }
                    case "forward":
                    case "backward": {
                      error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());
                      break;
                    }
                    default:
                      error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
                      break;
                  }
                } else {
                  error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
                }
              }
            }
          }
          function validateTailOptions(tailMode, revealOrder) {
            {
              if (tailMode !== void 0 && !didWarnAboutTailOptions[tailMode]) {
                if (tailMode !== "collapsed" && tailMode !== "hidden") {
                  didWarnAboutTailOptions[tailMode] = true;
                  error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?', tailMode);
                } else if (revealOrder !== "forwards" && revealOrder !== "backwards") {
                  didWarnAboutTailOptions[tailMode] = true;
                  error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', tailMode);
                }
              }
            }
          }
          function validateSuspenseListNestedChild(childSlot, index2) {
            {
              var isArray2 = Array.isArray(childSlot);
              var isIterable = !isArray2 && typeof getIteratorFn(childSlot) === "function";
              if (isArray2 || isIterable) {
                var type = isArray2 ? "array" : "iterable";
                error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", type, index2, type);
                return false;
              }
            }
            return true;
          }
          function validateSuspenseListChildren(children, revealOrder) {
            {
              if ((revealOrder === "forwards" || revealOrder === "backwards") && children !== void 0 && children !== null && children !== false) {
                if (Array.isArray(children)) {
                  for (var i = 0; i < children.length; i++) {
                    if (!validateSuspenseListNestedChild(children[i], i)) {
                      return;
                    }
                  }
                } else {
                  var iteratorFn = getIteratorFn(children);
                  if (typeof iteratorFn === "function") {
                    var childrenIterator = iteratorFn.call(children);
                    if (childrenIterator) {
                      var step = childrenIterator.next();
                      var _i = 0;
                      for (; !step.done; step = childrenIterator.next()) {
                        if (!validateSuspenseListNestedChild(step.value, _i)) {
                          return;
                        }
                        _i++;
                      }
                    }
                  } else {
                    error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', revealOrder);
                  }
                }
              }
            }
          }
          function initSuspenseListRenderState(workInProgress2, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {
            var renderState = workInProgress2.memoizedState;
            if (renderState === null) {
              workInProgress2.memoizedState = {
                isBackwards,
                rendering: null,
                renderingStartTime: 0,
                last: lastContentRow,
                tail,
                tailMode,
                lastEffect: lastEffectBeforeRendering
              };
            } else {
              renderState.isBackwards = isBackwards;
              renderState.rendering = null;
              renderState.renderingStartTime = 0;
              renderState.last = lastContentRow;
              renderState.tail = tail;
              renderState.tailMode = tailMode;
              renderState.lastEffect = lastEffectBeforeRendering;
            }
          }
          function updateSuspenseListComponent(current2, workInProgress2, renderLanes2) {
            var nextProps = workInProgress2.pendingProps;
            var revealOrder = nextProps.revealOrder;
            var tailMode = nextProps.tail;
            var newChildren = nextProps.children;
            validateRevealOrder(revealOrder);
            validateTailOptions(tailMode, revealOrder);
            validateSuspenseListChildren(newChildren, revealOrder);
            reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
            var suspenseContext = suspenseStackCursor.current;
            var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
            if (shouldForceFallback) {
              suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
              workInProgress2.flags |= DidCapture;
            } else {
              var didSuspendBefore = current2 !== null && (current2.flags & DidCapture) !== NoFlags;
              if (didSuspendBefore) {
                propagateSuspenseContextChange(workInProgress2, workInProgress2.child, renderLanes2);
              }
              suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
            }
            pushSuspenseContext(workInProgress2, suspenseContext);
            if ((workInProgress2.mode & BlockingMode) === NoMode) {
              workInProgress2.memoizedState = null;
            } else {
              switch (revealOrder) {
                case "forwards": {
                  var lastContentRow = findLastContentRow(workInProgress2.child);
                  var tail;
                  if (lastContentRow === null) {
                    tail = workInProgress2.child;
                    workInProgress2.child = null;
                  } else {
                    tail = lastContentRow.sibling;
                    lastContentRow.sibling = null;
                  }
                  initSuspenseListRenderState(
                    workInProgress2,
                    false,
                    tail,
                    lastContentRow,
                    tailMode,
                    workInProgress2.lastEffect
                  );
                  break;
                }
                case "backwards": {
                  var _tail = null;
                  var row = workInProgress2.child;
                  workInProgress2.child = null;
                  while (row !== null) {
                    var currentRow = row.alternate;
                    if (currentRow !== null && findFirstSuspended(currentRow) === null) {
                      workInProgress2.child = row;
                      break;
                    }
                    var nextRow = row.sibling;
                    row.sibling = _tail;
                    _tail = row;
                    row = nextRow;
                  }
                  initSuspenseListRenderState(
                    workInProgress2,
                    true,
                    _tail,
                    null,
                    tailMode,
                    workInProgress2.lastEffect
                  );
                  break;
                }
                case "together": {
                  initSuspenseListRenderState(
                    workInProgress2,
                    false,
                    null,
                    null,
                    void 0,
                    workInProgress2.lastEffect
                  );
                  break;
                }
                default: {
                  workInProgress2.memoizedState = null;
                }
              }
            }
            return workInProgress2.child;
          }
          function updatePortalComponent(current2, workInProgress2, renderLanes2) {
            pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
            var nextChildren = workInProgress2.pendingProps;
            if (current2 === null) {
              workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
            } else {
              reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            }
            return workInProgress2.child;
          }
          var hasWarnedAboutUsingNoValuePropOnContextProvider = false;
          function updateContextProvider(current2, workInProgress2, renderLanes2) {
            var providerType = workInProgress2.type;
            var context = providerType._context;
            var newProps = workInProgress2.pendingProps;
            var oldProps = workInProgress2.memoizedProps;
            var newValue = newProps.value;
            {
              if (!("value" in newProps)) {
                if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {
                  hasWarnedAboutUsingNoValuePropOnContextProvider = true;
                  error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?");
                }
              }
              var providerPropTypes = workInProgress2.type.propTypes;
              if (providerPropTypes) {
                checkPropTypes(providerPropTypes, newProps, "prop", "Context.Provider");
              }
            }
            pushProvider(workInProgress2, newValue);
            if (oldProps !== null) {
              var oldValue = oldProps.value;
              var changedBits = calculateChangedBits(context, newValue, oldValue);
              if (changedBits === 0) {
                if (oldProps.children === newProps.children && !hasContextChanged()) {
                  return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                }
              } else {
                propagateContextChange(workInProgress2, context, changedBits, renderLanes2);
              }
            }
            var newChildren = newProps.children;
            reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
            return workInProgress2.child;
          }
          var hasWarnedAboutUsingContextAsConsumer = false;
          function updateContextConsumer(current2, workInProgress2, renderLanes2) {
            var context = workInProgress2.type;
            {
              if (context._context === void 0) {
                if (context !== context.Consumer) {
                  if (!hasWarnedAboutUsingContextAsConsumer) {
                    hasWarnedAboutUsingContextAsConsumer = true;
                    error("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
                  }
                }
              } else {
                context = context._context;
              }
            }
            var newProps = workInProgress2.pendingProps;
            var render2 = newProps.children;
            {
              if (typeof render2 !== "function") {
                error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.");
              }
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            var newValue = readContext(context, newProps.unstable_observedBits);
            var newChildren;
            {
              ReactCurrentOwner$1.current = workInProgress2;
              setIsRendering(true);
              newChildren = render2(newValue);
              setIsRendering(false);
            }
            workInProgress2.flags |= PerformedWork;
            reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
            return workInProgress2.child;
          }
          function markWorkInProgressReceivedUpdate() {
            didReceiveUpdate = true;
          }
          function bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2) {
            if (current2 !== null) {
              workInProgress2.dependencies = current2.dependencies;
            }
            {
              stopProfilerTimerIfRunning();
            }
            markSkippedUpdateLanes(workInProgress2.lanes);
            if (!includesSomeLane(renderLanes2, workInProgress2.childLanes)) {
              return null;
            } else {
              cloneChildFibers(current2, workInProgress2);
              return workInProgress2.child;
            }
          }
          function remountFiber(current2, oldWorkInProgress, newWorkInProgress) {
            {
              var returnFiber = oldWorkInProgress.return;
              if (returnFiber === null) {
                throw new Error("Cannot swap the root fiber.");
              }
              current2.alternate = null;
              oldWorkInProgress.alternate = null;
              newWorkInProgress.index = oldWorkInProgress.index;
              newWorkInProgress.sibling = oldWorkInProgress.sibling;
              newWorkInProgress.return = oldWorkInProgress.return;
              newWorkInProgress.ref = oldWorkInProgress.ref;
              if (oldWorkInProgress === returnFiber.child) {
                returnFiber.child = newWorkInProgress;
              } else {
                var prevSibling = returnFiber.child;
                if (prevSibling === null) {
                  throw new Error("Expected parent to have a child.");
                }
                while (prevSibling.sibling !== oldWorkInProgress) {
                  prevSibling = prevSibling.sibling;
                  if (prevSibling === null) {
                    throw new Error("Expected to find the previous sibling.");
                  }
                }
                prevSibling.sibling = newWorkInProgress;
              }
              var last = returnFiber.lastEffect;
              if (last !== null) {
                last.nextEffect = current2;
                returnFiber.lastEffect = current2;
              } else {
                returnFiber.firstEffect = returnFiber.lastEffect = current2;
              }
              current2.nextEffect = null;
              current2.flags = Deletion;
              newWorkInProgress.flags |= Placement;
              return newWorkInProgress;
            }
          }
          function beginWork(current2, workInProgress2, renderLanes2) {
            var updateLanes = workInProgress2.lanes;
            {
              if (workInProgress2._debugNeedsRemount && current2 !== null) {
                return remountFiber(current2, workInProgress2, createFiberFromTypeAndProps(workInProgress2.type, workInProgress2.key, workInProgress2.pendingProps, workInProgress2._debugOwner || null, workInProgress2.mode, workInProgress2.lanes));
              }
            }
            if (current2 !== null) {
              var oldProps = current2.memoizedProps;
              var newProps = workInProgress2.pendingProps;
              if (oldProps !== newProps || hasContextChanged() || workInProgress2.type !== current2.type) {
                didReceiveUpdate = true;
              } else if (!includesSomeLane(renderLanes2, updateLanes)) {
                didReceiveUpdate = false;
                switch (workInProgress2.tag) {
                  case HostRoot:
                    pushHostRootContext(workInProgress2);
                    resetHydrationState();
                    break;
                  case HostComponent:
                    pushHostContext(workInProgress2);
                    break;
                  case ClassComponent: {
                    var Component2 = workInProgress2.type;
                    if (isContextProvider(Component2)) {
                      pushContextProvider(workInProgress2);
                    }
                    break;
                  }
                  case HostPortal:
                    pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
                    break;
                  case ContextProvider: {
                    var newValue = workInProgress2.memoizedProps.value;
                    pushProvider(workInProgress2, newValue);
                    break;
                  }
                  case Profiler:
                    {
                      var hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
                      if (hasChildWork) {
                        workInProgress2.flags |= Update;
                      }
                      var stateNode = workInProgress2.stateNode;
                      stateNode.effectDuration = 0;
                      stateNode.passiveEffectDuration = 0;
                    }
                    break;
                  case SuspenseComponent: {
                    var state = workInProgress2.memoizedState;
                    if (state !== null) {
                      var primaryChildFragment = workInProgress2.child;
                      var primaryChildLanes = primaryChildFragment.childLanes;
                      if (includesSomeLane(renderLanes2, primaryChildLanes)) {
                        return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
                      } else {
                        pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
                        var child = bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                        if (child !== null) {
                          return child.sibling;
                        } else {
                          return null;
                        }
                      }
                    } else {
                      pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
                    }
                    break;
                  }
                  case SuspenseListComponent: {
                    var didSuspendBefore = (current2.flags & DidCapture) !== NoFlags;
                    var _hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
                    if (didSuspendBefore) {
                      if (_hasChildWork) {
                        return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
                      }
                      workInProgress2.flags |= DidCapture;
                    }
                    var renderState = workInProgress2.memoizedState;
                    if (renderState !== null) {
                      renderState.rendering = null;
                      renderState.tail = null;
                      renderState.lastEffect = null;
                    }
                    pushSuspenseContext(workInProgress2, suspenseStackCursor.current);
                    if (_hasChildWork) {
                      break;
                    } else {
                      return null;
                    }
                  }
                  case OffscreenComponent:
                  case LegacyHiddenComponent: {
                    workInProgress2.lanes = NoLanes;
                    return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
                  }
                }
                return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
              } else {
                if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
                  didReceiveUpdate = true;
                } else {
                  didReceiveUpdate = false;
                }
              }
            } else {
              didReceiveUpdate = false;
            }
            workInProgress2.lanes = NoLanes;
            switch (workInProgress2.tag) {
              case IndeterminateComponent: {
                return mountIndeterminateComponent(current2, workInProgress2, workInProgress2.type, renderLanes2);
              }
              case LazyComponent: {
                var elementType = workInProgress2.elementType;
                return mountLazyComponent(current2, workInProgress2, elementType, updateLanes, renderLanes2);
              }
              case FunctionComponent: {
                var _Component = workInProgress2.type;
                var unresolvedProps = workInProgress2.pendingProps;
                var resolvedProps = workInProgress2.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);
                return updateFunctionComponent(current2, workInProgress2, _Component, resolvedProps, renderLanes2);
              }
              case ClassComponent: {
                var _Component2 = workInProgress2.type;
                var _unresolvedProps = workInProgress2.pendingProps;
                var _resolvedProps = workInProgress2.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);
                return updateClassComponent(current2, workInProgress2, _Component2, _resolvedProps, renderLanes2);
              }
              case HostRoot:
                return updateHostRoot(current2, workInProgress2, renderLanes2);
              case HostComponent:
                return updateHostComponent(current2, workInProgress2, renderLanes2);
              case HostText:
                return updateHostText(current2, workInProgress2);
              case SuspenseComponent:
                return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
              case HostPortal:
                return updatePortalComponent(current2, workInProgress2, renderLanes2);
              case ForwardRef: {
                var type = workInProgress2.type;
                var _unresolvedProps2 = workInProgress2.pendingProps;
                var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
                return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
              }
              case Fragment6:
                return updateFragment(current2, workInProgress2, renderLanes2);
              case Mode:
                return updateMode(current2, workInProgress2, renderLanes2);
              case Profiler:
                return updateProfiler(current2, workInProgress2, renderLanes2);
              case ContextProvider:
                return updateContextProvider(current2, workInProgress2, renderLanes2);
              case ContextConsumer:
                return updateContextConsumer(current2, workInProgress2, renderLanes2);
              case MemoComponent: {
                var _type2 = workInProgress2.type;
                var _unresolvedProps3 = workInProgress2.pendingProps;
                var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
                {
                  if (workInProgress2.type !== workInProgress2.elementType) {
                    var outerPropTypes = _type2.propTypes;
                    if (outerPropTypes) {
                      checkPropTypes(
                        outerPropTypes,
                        _resolvedProps3,
                        "prop",
                        getComponentName(_type2)
                      );
                    }
                  }
                }
                _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
                return updateMemoComponent(current2, workInProgress2, _type2, _resolvedProps3, updateLanes, renderLanes2);
              }
              case SimpleMemoComponent: {
                return updateSimpleMemoComponent(current2, workInProgress2, workInProgress2.type, workInProgress2.pendingProps, updateLanes, renderLanes2);
              }
              case IncompleteClassComponent: {
                var _Component3 = workInProgress2.type;
                var _unresolvedProps4 = workInProgress2.pendingProps;
                var _resolvedProps4 = workInProgress2.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);
                return mountIncompleteClassComponent(current2, workInProgress2, _Component3, _resolvedProps4, renderLanes2);
              }
              case SuspenseListComponent: {
                return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
              }
              case FundamentalComponent: {
                break;
              }
              case ScopeComponent: {
                break;
              }
              case Block: {
                break;
              }
              case OffscreenComponent: {
                return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
              }
              case LegacyHiddenComponent: {
                return updateLegacyHiddenComponent(current2, workInProgress2, renderLanes2);
              }
            }
            {
              {
                throw Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function markUpdate(workInProgress2) {
            workInProgress2.flags |= Update;
          }
          function markRef$1(workInProgress2) {
            workInProgress2.flags |= Ref;
          }
          var appendAllChildren;
          var updateHostContainer;
          var updateHostComponent$1;
          var updateHostText$1;
          {
            appendAllChildren = function(parent, workInProgress2, needsVisibilityToggle, isHidden) {
              var node = workInProgress2.child;
              while (node !== null) {
                if (node.tag === HostComponent || node.tag === HostText) {
                  appendInitialChild(parent, node.stateNode);
                } else if (node.tag === HostPortal)
                  ;
                else if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
                if (node === workInProgress2) {
                  return;
                }
                while (node.sibling === null) {
                  if (node.return === null || node.return === workInProgress2) {
                    return;
                  }
                  node = node.return;
                }
                node.sibling.return = node.return;
                node = node.sibling;
              }
            };
            updateHostContainer = function(workInProgress2) {
            };
            updateHostComponent$1 = function(current2, workInProgress2, type, newProps, rootContainerInstance) {
              var oldProps = current2.memoizedProps;
              if (oldProps === newProps) {
                return;
              }
              var instance = workInProgress2.stateNode;
              var currentHostContext = getHostContext();
              var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
              workInProgress2.updateQueue = updatePayload;
              if (updatePayload) {
                markUpdate(workInProgress2);
              }
            };
            updateHostText$1 = function(current2, workInProgress2, oldText, newText) {
              if (oldText !== newText) {
                markUpdate(workInProgress2);
              }
            };
          }
          function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
            if (getIsHydrating()) {
              return;
            }
            switch (renderState.tailMode) {
              case "hidden": {
                var tailNode = renderState.tail;
                var lastTailNode = null;
                while (tailNode !== null) {
                  if (tailNode.alternate !== null) {
                    lastTailNode = tailNode;
                  }
                  tailNode = tailNode.sibling;
                }
                if (lastTailNode === null) {
                  renderState.tail = null;
                } else {
                  lastTailNode.sibling = null;
                }
                break;
              }
              case "collapsed": {
                var _tailNode = renderState.tail;
                var _lastTailNode = null;
                while (_tailNode !== null) {
                  if (_tailNode.alternate !== null) {
                    _lastTailNode = _tailNode;
                  }
                  _tailNode = _tailNode.sibling;
                }
                if (_lastTailNode === null) {
                  if (!hasRenderedATailFallback && renderState.tail !== null) {
                    renderState.tail.sibling = null;
                  } else {
                    renderState.tail = null;
                  }
                } else {
                  _lastTailNode.sibling = null;
                }
                break;
              }
            }
          }
          function completeWork(current2, workInProgress2, renderLanes2) {
            var newProps = workInProgress2.pendingProps;
            switch (workInProgress2.tag) {
              case IndeterminateComponent:
              case LazyComponent:
              case SimpleMemoComponent:
              case FunctionComponent:
              case ForwardRef:
              case Fragment6:
              case Mode:
              case Profiler:
              case ContextConsumer:
              case MemoComponent:
                return null;
              case ClassComponent: {
                var Component2 = workInProgress2.type;
                if (isContextProvider(Component2)) {
                  popContext(workInProgress2);
                }
                return null;
              }
              case HostRoot: {
                popHostContainer(workInProgress2);
                popTopLevelContextObject(workInProgress2);
                resetWorkInProgressVersions();
                var fiberRoot = workInProgress2.stateNode;
                if (fiberRoot.pendingContext) {
                  fiberRoot.context = fiberRoot.pendingContext;
                  fiberRoot.pendingContext = null;
                }
                if (current2 === null || current2.child === null) {
                  var wasHydrated = popHydrationState(workInProgress2);
                  if (wasHydrated) {
                    markUpdate(workInProgress2);
                  } else if (!fiberRoot.hydrate) {
                    workInProgress2.flags |= Snapshot;
                  }
                }
                updateHostContainer(workInProgress2);
                return null;
              }
              case HostComponent: {
                popHostContext(workInProgress2);
                var rootContainerInstance = getRootHostContainer();
                var type = workInProgress2.type;
                if (current2 !== null && workInProgress2.stateNode != null) {
                  updateHostComponent$1(current2, workInProgress2, type, newProps, rootContainerInstance);
                  if (current2.ref !== workInProgress2.ref) {
                    markRef$1(workInProgress2);
                  }
                } else {
                  if (!newProps) {
                    if (!(workInProgress2.stateNode !== null)) {
                      {
                        throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
                      }
                    }
                    return null;
                  }
                  var currentHostContext = getHostContext();
                  var _wasHydrated = popHydrationState(workInProgress2);
                  if (_wasHydrated) {
                    if (prepareToHydrateHostInstance(workInProgress2, rootContainerInstance, currentHostContext)) {
                      markUpdate(workInProgress2);
                    }
                  } else {
                    var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress2);
                    appendAllChildren(instance, workInProgress2, false, false);
                    workInProgress2.stateNode = instance;
                    if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {
                      markUpdate(workInProgress2);
                    }
                  }
                  if (workInProgress2.ref !== null) {
                    markRef$1(workInProgress2);
                  }
                }
                return null;
              }
              case HostText: {
                var newText = newProps;
                if (current2 && workInProgress2.stateNode != null) {
                  var oldText = current2.memoizedProps;
                  updateHostText$1(current2, workInProgress2, oldText, newText);
                } else {
                  if (typeof newText !== "string") {
                    if (!(workInProgress2.stateNode !== null)) {
                      {
                        throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
                      }
                    }
                  }
                  var _rootContainerInstance = getRootHostContainer();
                  var _currentHostContext = getHostContext();
                  var _wasHydrated2 = popHydrationState(workInProgress2);
                  if (_wasHydrated2) {
                    if (prepareToHydrateHostTextInstance(workInProgress2)) {
                      markUpdate(workInProgress2);
                    }
                  } else {
                    workInProgress2.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress2);
                  }
                }
                return null;
              }
              case SuspenseComponent: {
                popSuspenseContext(workInProgress2);
                var nextState = workInProgress2.memoizedState;
                if ((workInProgress2.flags & DidCapture) !== NoFlags) {
                  workInProgress2.lanes = renderLanes2;
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    transferActualDuration(workInProgress2);
                  }
                  return workInProgress2;
                }
                var nextDidTimeout = nextState !== null;
                var prevDidTimeout = false;
                if (current2 === null) {
                  if (workInProgress2.memoizedProps.fallback !== void 0) {
                    popHydrationState(workInProgress2);
                  }
                } else {
                  var prevState = current2.memoizedState;
                  prevDidTimeout = prevState !== null;
                }
                if (nextDidTimeout && !prevDidTimeout) {
                  if ((workInProgress2.mode & BlockingMode) !== NoMode) {
                    var hasInvisibleChildContext = current2 === null && workInProgress2.memoizedProps.unstable_avoidThisFallback !== true;
                    if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
                      renderDidSuspend();
                    } else {
                      renderDidSuspendDelayIfPossible();
                    }
                  }
                }
                {
                  if (nextDidTimeout || prevDidTimeout) {
                    workInProgress2.flags |= Update;
                  }
                }
                return null;
              }
              case HostPortal:
                popHostContainer(workInProgress2);
                updateHostContainer(workInProgress2);
                if (current2 === null) {
                  preparePortalMount(workInProgress2.stateNode.containerInfo);
                }
                return null;
              case ContextProvider:
                popProvider(workInProgress2);
                return null;
              case IncompleteClassComponent: {
                var _Component = workInProgress2.type;
                if (isContextProvider(_Component)) {
                  popContext(workInProgress2);
                }
                return null;
              }
              case SuspenseListComponent: {
                popSuspenseContext(workInProgress2);
                var renderState = workInProgress2.memoizedState;
                if (renderState === null) {
                  return null;
                }
                var didSuspendAlready = (workInProgress2.flags & DidCapture) !== NoFlags;
                var renderedTail = renderState.rendering;
                if (renderedTail === null) {
                  if (!didSuspendAlready) {
                    var cannotBeSuspended = renderHasNotSuspendedYet() && (current2 === null || (current2.flags & DidCapture) === NoFlags);
                    if (!cannotBeSuspended) {
                      var row = workInProgress2.child;
                      while (row !== null) {
                        var suspended = findFirstSuspended(row);
                        if (suspended !== null) {
                          didSuspendAlready = true;
                          workInProgress2.flags |= DidCapture;
                          cutOffTailIfNeeded(renderState, false);
                          var newThennables = suspended.updateQueue;
                          if (newThennables !== null) {
                            workInProgress2.updateQueue = newThennables;
                            workInProgress2.flags |= Update;
                          }
                          if (renderState.lastEffect === null) {
                            workInProgress2.firstEffect = null;
                          }
                          workInProgress2.lastEffect = renderState.lastEffect;
                          resetChildFibers(workInProgress2, renderLanes2);
                          pushSuspenseContext(workInProgress2, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
                          return workInProgress2.child;
                        }
                        row = row.sibling;
                      }
                    }
                    if (renderState.tail !== null && now() > getRenderTargetTime()) {
                      workInProgress2.flags |= DidCapture;
                      didSuspendAlready = true;
                      cutOffTailIfNeeded(renderState, false);
                      workInProgress2.lanes = SomeRetryLane;
                      {
                        markSpawnedWork(SomeRetryLane);
                      }
                    }
                  } else {
                    cutOffTailIfNeeded(renderState, false);
                  }
                } else {
                  if (!didSuspendAlready) {
                    var _suspended = findFirstSuspended(renderedTail);
                    if (_suspended !== null) {
                      workInProgress2.flags |= DidCapture;
                      didSuspendAlready = true;
                      var _newThennables = _suspended.updateQueue;
                      if (_newThennables !== null) {
                        workInProgress2.updateQueue = _newThennables;
                        workInProgress2.flags |= Update;
                      }
                      cutOffTailIfNeeded(renderState, true);
                      if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate && !getIsHydrating()) {
                        var lastEffect = workInProgress2.lastEffect = renderState.lastEffect;
                        if (lastEffect !== null) {
                          lastEffect.nextEffect = null;
                        }
                        return null;
                      }
                    } else if (now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes2 !== OffscreenLane) {
                      workInProgress2.flags |= DidCapture;
                      didSuspendAlready = true;
                      cutOffTailIfNeeded(renderState, false);
                      workInProgress2.lanes = SomeRetryLane;
                      {
                        markSpawnedWork(SomeRetryLane);
                      }
                    }
                  }
                  if (renderState.isBackwards) {
                    renderedTail.sibling = workInProgress2.child;
                    workInProgress2.child = renderedTail;
                  } else {
                    var previousSibling = renderState.last;
                    if (previousSibling !== null) {
                      previousSibling.sibling = renderedTail;
                    } else {
                      workInProgress2.child = renderedTail;
                    }
                    renderState.last = renderedTail;
                  }
                }
                if (renderState.tail !== null) {
                  var next = renderState.tail;
                  renderState.rendering = next;
                  renderState.tail = next.sibling;
                  renderState.lastEffect = workInProgress2.lastEffect;
                  renderState.renderingStartTime = now();
                  next.sibling = null;
                  var suspenseContext = suspenseStackCursor.current;
                  if (didSuspendAlready) {
                    suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
                  } else {
                    suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
                  }
                  pushSuspenseContext(workInProgress2, suspenseContext);
                  return next;
                }
                return null;
              }
              case FundamentalComponent: {
                break;
              }
              case ScopeComponent: {
                break;
              }
              case Block:
                break;
              case OffscreenComponent:
              case LegacyHiddenComponent: {
                popRenderLanes(workInProgress2);
                if (current2 !== null) {
                  var _nextState = workInProgress2.memoizedState;
                  var _prevState = current2.memoizedState;
                  var prevIsHidden = _prevState !== null;
                  var nextIsHidden = _nextState !== null;
                  if (prevIsHidden !== nextIsHidden && newProps.mode !== "unstable-defer-without-hiding") {
                    workInProgress2.flags |= Update;
                  }
                }
                return null;
              }
            }
            {
              {
                throw Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function unwindWork(workInProgress2, renderLanes2) {
            switch (workInProgress2.tag) {
              case ClassComponent: {
                var Component2 = workInProgress2.type;
                if (isContextProvider(Component2)) {
                  popContext(workInProgress2);
                }
                var flags = workInProgress2.flags;
                if (flags & ShouldCapture) {
                  workInProgress2.flags = flags & ~ShouldCapture | DidCapture;
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    transferActualDuration(workInProgress2);
                  }
                  return workInProgress2;
                }
                return null;
              }
              case HostRoot: {
                popHostContainer(workInProgress2);
                popTopLevelContextObject(workInProgress2);
                resetWorkInProgressVersions();
                var _flags = workInProgress2.flags;
                if (!((_flags & DidCapture) === NoFlags)) {
                  {
                    throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue.");
                  }
                }
                workInProgress2.flags = _flags & ~ShouldCapture | DidCapture;
                return workInProgress2;
              }
              case HostComponent: {
                popHostContext(workInProgress2);
                return null;
              }
              case SuspenseComponent: {
                popSuspenseContext(workInProgress2);
                var _flags2 = workInProgress2.flags;
                if (_flags2 & ShouldCapture) {
                  workInProgress2.flags = _flags2 & ~ShouldCapture | DidCapture;
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    transferActualDuration(workInProgress2);
                  }
                  return workInProgress2;
                }
                return null;
              }
              case SuspenseListComponent: {
                popSuspenseContext(workInProgress2);
                return null;
              }
              case HostPortal:
                popHostContainer(workInProgress2);
                return null;
              case ContextProvider:
                popProvider(workInProgress2);
                return null;
              case OffscreenComponent:
              case LegacyHiddenComponent:
                popRenderLanes(workInProgress2);
                return null;
              default:
                return null;
            }
          }
          function unwindInterruptedWork(interruptedWork) {
            switch (interruptedWork.tag) {
              case ClassComponent: {
                var childContextTypes = interruptedWork.type.childContextTypes;
                if (childContextTypes !== null && childContextTypes !== void 0) {
                  popContext(interruptedWork);
                }
                break;
              }
              case HostRoot: {
                popHostContainer(interruptedWork);
                popTopLevelContextObject(interruptedWork);
                resetWorkInProgressVersions();
                break;
              }
              case HostComponent: {
                popHostContext(interruptedWork);
                break;
              }
              case HostPortal:
                popHostContainer(interruptedWork);
                break;
              case SuspenseComponent:
                popSuspenseContext(interruptedWork);
                break;
              case SuspenseListComponent:
                popSuspenseContext(interruptedWork);
                break;
              case ContextProvider:
                popProvider(interruptedWork);
                break;
              case OffscreenComponent:
              case LegacyHiddenComponent:
                popRenderLanes(interruptedWork);
                break;
            }
          }
          function createCapturedValue(value, source) {
            return {
              value,
              source,
              stack: getStackByFiberInDevAndProd(source)
            };
          }
          function showErrorDialog(boundary, errorInfo) {
            return true;
          }
          function logCapturedError(boundary, errorInfo) {
            try {
              var logError = showErrorDialog(boundary, errorInfo);
              if (logError === false) {
                return;
              }
              var error2 = errorInfo.value;
              if (true) {
                var source = errorInfo.source;
                var stack = errorInfo.stack;
                var componentStack = stack !== null ? stack : "";
                if (error2 != null && error2._suppressLogging) {
                  if (boundary.tag === ClassComponent) {
                    return;
                  }
                  console["error"](error2);
                }
                var componentName = source ? getComponentName(source.type) : null;
                var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:";
                var errorBoundaryMessage;
                var errorBoundaryName = getComponentName(boundary.type);
                if (errorBoundaryName) {
                  errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
                } else {
                  errorBoundaryMessage = "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries.";
                }
                var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage);
                console["error"](combinedMessage);
              } else {
                console["error"](error2);
              }
            } catch (e) {
              setTimeout(function() {
                throw e;
              });
            }
          }
          var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map;
          function createRootErrorUpdate(fiber, errorInfo, lane) {
            var update = createUpdate(NoTimestamp, lane);
            update.tag = CaptureUpdate;
            update.payload = {
              element: null
            };
            var error2 = errorInfo.value;
            update.callback = function() {
              onUncaughtError(error2);
              logCapturedError(fiber, errorInfo);
            };
            return update;
          }
          function createClassErrorUpdate(fiber, errorInfo, lane) {
            var update = createUpdate(NoTimestamp, lane);
            update.tag = CaptureUpdate;
            var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
            if (typeof getDerivedStateFromError === "function") {
              var error$1 = errorInfo.value;
              update.payload = function() {
                logCapturedError(fiber, errorInfo);
                return getDerivedStateFromError(error$1);
              };
            }
            var inst = fiber.stateNode;
            if (inst !== null && typeof inst.componentDidCatch === "function") {
              update.callback = function callback() {
                {
                  markFailedErrorBoundaryForHotReloading(fiber);
                }
                if (typeof getDerivedStateFromError !== "function") {
                  markLegacyErrorBoundaryAsFailed(this);
                  logCapturedError(fiber, errorInfo);
                }
                var error$12 = errorInfo.value;
                var stack = errorInfo.stack;
                this.componentDidCatch(error$12, {
                  componentStack: stack !== null ? stack : ""
                });
                {
                  if (typeof getDerivedStateFromError !== "function") {
                    if (!includesSomeLane(fiber.lanes, SyncLane)) {
                      error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentName(fiber.type) || "Unknown");
                    }
                  }
                }
              };
            } else {
              update.callback = function() {
                markFailedErrorBoundaryForHotReloading(fiber);
              };
            }
            return update;
          }
          function attachPingListener(root2, wakeable, lanes) {
            var pingCache = root2.pingCache;
            var threadIDs;
            if (pingCache === null) {
              pingCache = root2.pingCache = new PossiblyWeakMap$1();
              threadIDs = /* @__PURE__ */ new Set();
              pingCache.set(wakeable, threadIDs);
            } else {
              threadIDs = pingCache.get(wakeable);
              if (threadIDs === void 0) {
                threadIDs = /* @__PURE__ */ new Set();
                pingCache.set(wakeable, threadIDs);
              }
            }
            if (!threadIDs.has(lanes)) {
              threadIDs.add(lanes);
              var ping = pingSuspendedRoot.bind(null, root2, wakeable, lanes);
              wakeable.then(ping, ping);
            }
          }
          function throwException(root2, returnFiber, sourceFiber, value, rootRenderLanes) {
            sourceFiber.flags |= Incomplete;
            sourceFiber.firstEffect = sourceFiber.lastEffect = null;
            if (value !== null && typeof value === "object" && typeof value.then === "function") {
              var wakeable = value;
              if ((sourceFiber.mode & BlockingMode) === NoMode) {
                var currentSource = sourceFiber.alternate;
                if (currentSource) {
                  sourceFiber.updateQueue = currentSource.updateQueue;
                  sourceFiber.memoizedState = currentSource.memoizedState;
                  sourceFiber.lanes = currentSource.lanes;
                } else {
                  sourceFiber.updateQueue = null;
                  sourceFiber.memoizedState = null;
                }
              }
              var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext);
              var _workInProgress = returnFiber;
              do {
                if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {
                  var wakeables = _workInProgress.updateQueue;
                  if (wakeables === null) {
                    var updateQueue = /* @__PURE__ */ new Set();
                    updateQueue.add(wakeable);
                    _workInProgress.updateQueue = updateQueue;
                  } else {
                    wakeables.add(wakeable);
                  }
                  if ((_workInProgress.mode & BlockingMode) === NoMode) {
                    _workInProgress.flags |= DidCapture;
                    sourceFiber.flags |= ForceUpdateForLegacySuspense;
                    sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
                    if (sourceFiber.tag === ClassComponent) {
                      var currentSourceFiber = sourceFiber.alternate;
                      if (currentSourceFiber === null) {
                        sourceFiber.tag = IncompleteClassComponent;
                      } else {
                        var update = createUpdate(NoTimestamp, SyncLane);
                        update.tag = ForceUpdate;
                        enqueueUpdate(sourceFiber, update);
                      }
                    }
                    sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
                    return;
                  }
                  attachPingListener(root2, wakeable, rootRenderLanes);
                  _workInProgress.flags |= ShouldCapture;
                  _workInProgress.lanes = rootRenderLanes;
                  return;
                }
                _workInProgress = _workInProgress.return;
              } while (_workInProgress !== null);
              value = new Error((getComponentName(sourceFiber.type) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.");
            }
            renderDidError();
            value = createCapturedValue(value, sourceFiber);
            var workInProgress2 = returnFiber;
            do {
              switch (workInProgress2.tag) {
                case HostRoot: {
                  var _errorInfo = value;
                  workInProgress2.flags |= ShouldCapture;
                  var lane = pickArbitraryLane(rootRenderLanes);
                  workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
                  var _update = createRootErrorUpdate(workInProgress2, _errorInfo, lane);
                  enqueueCapturedUpdate(workInProgress2, _update);
                  return;
                }
                case ClassComponent:
                  var errorInfo = value;
                  var ctor = workInProgress2.type;
                  var instance = workInProgress2.stateNode;
                  if ((workInProgress2.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === "function" || instance !== null && typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance))) {
                    workInProgress2.flags |= ShouldCapture;
                    var _lane = pickArbitraryLane(rootRenderLanes);
                    workInProgress2.lanes = mergeLanes(workInProgress2.lanes, _lane);
                    var _update2 = createClassErrorUpdate(workInProgress2, errorInfo, _lane);
                    enqueueCapturedUpdate(workInProgress2, _update2);
                    return;
                  }
                  break;
              }
              workInProgress2 = workInProgress2.return;
            } while (workInProgress2 !== null);
          }
          var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
          {
            didWarnAboutUndefinedSnapshotBeforeUpdate = /* @__PURE__ */ new Set();
          }
          var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set;
          var callComponentWillUnmountWithTimer = function(current2, instance) {
            instance.props = current2.memoizedProps;
            instance.state = current2.memoizedState;
            {
              instance.componentWillUnmount();
            }
          };
          function safelyCallComponentWillUnmount(current2, instance) {
            {
              invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current2, instance);
              if (hasCaughtError()) {
                var unmountError = clearCaughtError();
                captureCommitPhaseError(current2, unmountError);
              }
            }
          }
          function safelyDetachRef(current2) {
            var ref = current2.ref;
            if (ref !== null) {
              if (typeof ref === "function") {
                {
                  invokeGuardedCallback(null, ref, null, null);
                  if (hasCaughtError()) {
                    var refError = clearCaughtError();
                    captureCommitPhaseError(current2, refError);
                  }
                }
              } else {
                ref.current = null;
              }
            }
          }
          function safelyCallDestroy(current2, destroy) {
            {
              invokeGuardedCallback(null, destroy, null);
              if (hasCaughtError()) {
                var error2 = clearCaughtError();
                captureCommitPhaseError(current2, error2);
              }
            }
          }
          function commitBeforeMutationLifeCycles(current2, finishedWork) {
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent:
              case Block: {
                return;
              }
              case ClassComponent: {
                if (finishedWork.flags & Snapshot) {
                  if (current2 !== null) {
                    var prevProps = current2.memoizedProps;
                    var prevState = current2.memoizedState;
                    var instance = finishedWork.stateNode;
                    {
                      if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                        if (instance.props !== finishedWork.memoizedProps) {
                          error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                        }
                        if (instance.state !== finishedWork.memoizedState) {
                          error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                        }
                      }
                    }
                    var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
                    {
                      var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
                      if (snapshot === void 0 && !didWarnSet.has(finishedWork.type)) {
                        didWarnSet.add(finishedWork.type);
                        error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", getComponentName(finishedWork.type));
                      }
                    }
                    instance.__reactInternalSnapshotBeforeUpdate = snapshot;
                  }
                }
                return;
              }
              case HostRoot: {
                {
                  if (finishedWork.flags & Snapshot) {
                    var root2 = finishedWork.stateNode;
                    clearContainer(root2.containerInfo);
                  }
                }
                return;
              }
              case HostComponent:
              case HostText:
              case HostPortal:
              case IncompleteClassComponent:
                return;
            }
            {
              {
                throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function commitHookEffectListUnmount(tag, finishedWork) {
            var updateQueue = finishedWork.updateQueue;
            var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
            if (lastEffect !== null) {
              var firstEffect = lastEffect.next;
              var effect = firstEffect;
              do {
                if ((effect.tag & tag) === tag) {
                  var destroy = effect.destroy;
                  effect.destroy = void 0;
                  if (destroy !== void 0) {
                    destroy();
                  }
                }
                effect = effect.next;
              } while (effect !== firstEffect);
            }
          }
          function commitHookEffectListMount(tag, finishedWork) {
            var updateQueue = finishedWork.updateQueue;
            var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
            if (lastEffect !== null) {
              var firstEffect = lastEffect.next;
              var effect = firstEffect;
              do {
                if ((effect.tag & tag) === tag) {
                  var create = effect.create;
                  effect.destroy = create();
                  {
                    var destroy = effect.destroy;
                    if (destroy !== void 0 && typeof destroy !== "function") {
                      var addendum = void 0;
                      if (destroy === null) {
                        addendum = " You returned null. If your effect does not require clean up, return undefined (or nothing).";
                      } else if (typeof destroy.then === "function") {
                        addendum = "\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\nuseEffect(() => {\n  async function fetchData() {\n    // You can await here\n    const response = await MyAPI.getData(someId);\n    // ...\n  }\n  fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching";
                      } else {
                        addendum = " You returned: " + destroy;
                      }
                      error("An effect function must not return anything besides a function, which is used for clean-up.%s", addendum);
                    }
                  }
                }
                effect = effect.next;
              } while (effect !== firstEffect);
            }
          }
          function schedulePassiveEffects(finishedWork) {
            var updateQueue = finishedWork.updateQueue;
            var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
            if (lastEffect !== null) {
              var firstEffect = lastEffect.next;
              var effect = firstEffect;
              do {
                var _effect = effect, next = _effect.next, tag = _effect.tag;
                if ((tag & Passive$1) !== NoFlags$1 && (tag & HasEffect) !== NoFlags$1) {
                  enqueuePendingPassiveHookEffectUnmount(finishedWork, effect);
                  enqueuePendingPassiveHookEffectMount(finishedWork, effect);
                }
                effect = next;
              } while (effect !== firstEffect);
            }
          }
          function commitLifeCycles(finishedRoot, current2, finishedWork, committedLanes) {
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent:
              case Block: {
                {
                  commitHookEffectListMount(Layout | HasEffect, finishedWork);
                }
                schedulePassiveEffects(finishedWork);
                return;
              }
              case ClassComponent: {
                var instance = finishedWork.stateNode;
                if (finishedWork.flags & Update) {
                  if (current2 === null) {
                    {
                      if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                        if (instance.props !== finishedWork.memoizedProps) {
                          error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                        }
                        if (instance.state !== finishedWork.memoizedState) {
                          error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                        }
                      }
                    }
                    {
                      instance.componentDidMount();
                    }
                  } else {
                    var prevProps = finishedWork.elementType === finishedWork.type ? current2.memoizedProps : resolveDefaultProps(finishedWork.type, current2.memoizedProps);
                    var prevState = current2.memoizedState;
                    {
                      if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                        if (instance.props !== finishedWork.memoizedProps) {
                          error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                        }
                        if (instance.state !== finishedWork.memoizedState) {
                          error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                        }
                      }
                    }
                    {
                      instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
                    }
                  }
                }
                var updateQueue = finishedWork.updateQueue;
                if (updateQueue !== null) {
                  {
                    if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                      if (instance.props !== finishedWork.memoizedProps) {
                        error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                      }
                      if (instance.state !== finishedWork.memoizedState) {
                        error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                      }
                    }
                  }
                  commitUpdateQueue(finishedWork, updateQueue, instance);
                }
                return;
              }
              case HostRoot: {
                var _updateQueue = finishedWork.updateQueue;
                if (_updateQueue !== null) {
                  var _instance = null;
                  if (finishedWork.child !== null) {
                    switch (finishedWork.child.tag) {
                      case HostComponent:
                        _instance = getPublicInstance(finishedWork.child.stateNode);
                        break;
                      case ClassComponent:
                        _instance = finishedWork.child.stateNode;
                        break;
                    }
                  }
                  commitUpdateQueue(finishedWork, _updateQueue, _instance);
                }
                return;
              }
              case HostComponent: {
                var _instance2 = finishedWork.stateNode;
                if (current2 === null && finishedWork.flags & Update) {
                  var type = finishedWork.type;
                  var props = finishedWork.memoizedProps;
                  commitMount(_instance2, type, props);
                }
                return;
              }
              case HostText: {
                return;
              }
              case HostPortal: {
                return;
              }
              case Profiler: {
                {
                  var _finishedWork$memoize2 = finishedWork.memoizedProps, onCommit = _finishedWork$memoize2.onCommit, onRender = _finishedWork$memoize2.onRender;
                  var effectDuration = finishedWork.stateNode.effectDuration;
                  var commitTime2 = getCommitTime();
                  if (typeof onRender === "function") {
                    {
                      onRender(finishedWork.memoizedProps.id, current2 === null ? "mount" : "update", finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime2, finishedRoot.memoizedInteractions);
                    }
                  }
                }
                return;
              }
              case SuspenseComponent: {
                commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
                return;
              }
              case SuspenseListComponent:
              case IncompleteClassComponent:
              case FundamentalComponent:
              case ScopeComponent:
              case OffscreenComponent:
              case LegacyHiddenComponent:
                return;
            }
            {
              {
                throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function hideOrUnhideAllChildren(finishedWork, isHidden) {
            {
              var node = finishedWork;
              while (true) {
                if (node.tag === HostComponent) {
                  var instance = node.stateNode;
                  if (isHidden) {
                    hideInstance(instance);
                  } else {
                    unhideInstance(node.stateNode, node.memoizedProps);
                  }
                } else if (node.tag === HostText) {
                  var _instance3 = node.stateNode;
                  if (isHidden) {
                    hideTextInstance(_instance3);
                  } else {
                    unhideTextInstance(_instance3, node.memoizedProps);
                  }
                } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork)
                  ;
                else if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
                if (node === finishedWork) {
                  return;
                }
                while (node.sibling === null) {
                  if (node.return === null || node.return === finishedWork) {
                    return;
                  }
                  node = node.return;
                }
                node.sibling.return = node.return;
                node = node.sibling;
              }
            }
          }
          function commitAttachRef(finishedWork) {
            var ref = finishedWork.ref;
            if (ref !== null) {
              var instance = finishedWork.stateNode;
              var instanceToUse;
              switch (finishedWork.tag) {
                case HostComponent:
                  instanceToUse = getPublicInstance(instance);
                  break;
                default:
                  instanceToUse = instance;
              }
              if (typeof ref === "function") {
                ref(instanceToUse);
              } else {
                {
                  if (!ref.hasOwnProperty("current")) {
                    error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", getComponentName(finishedWork.type));
                  }
                }
                ref.current = instanceToUse;
              }
            }
          }
          function commitDetachRef(current2) {
            var currentRef = current2.ref;
            if (currentRef !== null) {
              if (typeof currentRef === "function") {
                currentRef(null);
              } else {
                currentRef.current = null;
              }
            }
          }
          function commitUnmount(finishedRoot, current2, renderPriorityLevel) {
            onCommitUnmount(current2);
            switch (current2.tag) {
              case FunctionComponent:
              case ForwardRef:
              case MemoComponent:
              case SimpleMemoComponent:
              case Block: {
                var updateQueue = current2.updateQueue;
                if (updateQueue !== null) {
                  var lastEffect = updateQueue.lastEffect;
                  if (lastEffect !== null) {
                    var firstEffect = lastEffect.next;
                    var effect = firstEffect;
                    do {
                      var _effect2 = effect, destroy = _effect2.destroy, tag = _effect2.tag;
                      if (destroy !== void 0) {
                        if ((tag & Passive$1) !== NoFlags$1) {
                          enqueuePendingPassiveHookEffectUnmount(current2, effect);
                        } else {
                          {
                            safelyCallDestroy(current2, destroy);
                          }
                        }
                      }
                      effect = effect.next;
                    } while (effect !== firstEffect);
                  }
                }
                return;
              }
              case ClassComponent: {
                safelyDetachRef(current2);
                var instance = current2.stateNode;
                if (typeof instance.componentWillUnmount === "function") {
                  safelyCallComponentWillUnmount(current2, instance);
                }
                return;
              }
              case HostComponent: {
                safelyDetachRef(current2);
                return;
              }
              case HostPortal: {
                {
                  unmountHostComponents(finishedRoot, current2);
                }
                return;
              }
              case FundamentalComponent: {
                return;
              }
              case DehydratedFragment: {
                return;
              }
              case ScopeComponent: {
                return;
              }
            }
          }
          function commitNestedUnmounts(finishedRoot, root2, renderPriorityLevel) {
            var node = root2;
            while (true) {
              commitUnmount(finishedRoot, node);
              if (node.child !== null && node.tag !== HostPortal) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === root2) {
                return;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === root2) {
                  return;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
          }
          function detachFiberMutation(fiber) {
            fiber.alternate = null;
            fiber.child = null;
            fiber.dependencies = null;
            fiber.firstEffect = null;
            fiber.lastEffect = null;
            fiber.memoizedProps = null;
            fiber.memoizedState = null;
            fiber.pendingProps = null;
            fiber.return = null;
            fiber.updateQueue = null;
            {
              fiber._debugOwner = null;
            }
          }
          function getHostParentFiber(fiber) {
            var parent = fiber.return;
            while (parent !== null) {
              if (isHostParent(parent)) {
                return parent;
              }
              parent = parent.return;
            }
            {
              {
                throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function isHostParent(fiber) {
            return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
          }
          function getHostSibling(fiber) {
            var node = fiber;
            siblings:
              while (true) {
                while (node.sibling === null) {
                  if (node.return === null || isHostParent(node.return)) {
                    return null;
                  }
                  node = node.return;
                }
                node.sibling.return = node.return;
                node = node.sibling;
                while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
                  if (node.flags & Placement) {
                    continue siblings;
                  }
                  if (node.child === null || node.tag === HostPortal) {
                    continue siblings;
                  } else {
                    node.child.return = node;
                    node = node.child;
                  }
                }
                if (!(node.flags & Placement)) {
                  return node.stateNode;
                }
              }
          }
          function commitPlacement(finishedWork) {
            var parentFiber = getHostParentFiber(finishedWork);
            var parent;
            var isContainer;
            var parentStateNode = parentFiber.stateNode;
            switch (parentFiber.tag) {
              case HostComponent:
                parent = parentStateNode;
                isContainer = false;
                break;
              case HostRoot:
                parent = parentStateNode.containerInfo;
                isContainer = true;
                break;
              case HostPortal:
                parent = parentStateNode.containerInfo;
                isContainer = true;
                break;
              case FundamentalComponent:
              default: {
                {
                  throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
            }
            if (parentFiber.flags & ContentReset) {
              resetTextContent(parent);
              parentFiber.flags &= ~ContentReset;
            }
            var before = getHostSibling(finishedWork);
            if (isContainer) {
              insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent);
            } else {
              insertOrAppendPlacementNode(finishedWork, before, parent);
            }
          }
          function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
            var tag = node.tag;
            var isHost = tag === HostComponent || tag === HostText;
            if (isHost || enableFundamentalAPI) {
              var stateNode = isHost ? node.stateNode : node.stateNode.instance;
              if (before) {
                insertInContainerBefore(parent, stateNode, before);
              } else {
                appendChildToContainer(parent, stateNode);
              }
            } else if (tag === HostPortal)
              ;
            else {
              var child = node.child;
              if (child !== null) {
                insertOrAppendPlacementNodeIntoContainer(child, before, parent);
                var sibling = child.sibling;
                while (sibling !== null) {
                  insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
                  sibling = sibling.sibling;
                }
              }
            }
          }
          function insertOrAppendPlacementNode(node, before, parent) {
            var tag = node.tag;
            var isHost = tag === HostComponent || tag === HostText;
            if (isHost || enableFundamentalAPI) {
              var stateNode = isHost ? node.stateNode : node.stateNode.instance;
              if (before) {
                insertBefore(parent, stateNode, before);
              } else {
                appendChild(parent, stateNode);
              }
            } else if (tag === HostPortal)
              ;
            else {
              var child = node.child;
              if (child !== null) {
                insertOrAppendPlacementNode(child, before, parent);
                var sibling = child.sibling;
                while (sibling !== null) {
                  insertOrAppendPlacementNode(sibling, before, parent);
                  sibling = sibling.sibling;
                }
              }
            }
          }
          function unmountHostComponents(finishedRoot, current2, renderPriorityLevel) {
            var node = current2;
            var currentParentIsValid = false;
            var currentParent;
            var currentParentIsContainer;
            while (true) {
              if (!currentParentIsValid) {
                var parent = node.return;
                findParent:
                  while (true) {
                    if (!(parent !== null)) {
                      {
                        throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
                      }
                    }
                    var parentStateNode = parent.stateNode;
                    switch (parent.tag) {
                      case HostComponent:
                        currentParent = parentStateNode;
                        currentParentIsContainer = false;
                        break findParent;
                      case HostRoot:
                        currentParent = parentStateNode.containerInfo;
                        currentParentIsContainer = true;
                        break findParent;
                      case HostPortal:
                        currentParent = parentStateNode.containerInfo;
                        currentParentIsContainer = true;
                        break findParent;
                    }
                    parent = parent.return;
                  }
                currentParentIsValid = true;
              }
              if (node.tag === HostComponent || node.tag === HostText) {
                commitNestedUnmounts(finishedRoot, node);
                if (currentParentIsContainer) {
                  removeChildFromContainer(currentParent, node.stateNode);
                } else {
                  removeChild(currentParent, node.stateNode);
                }
              } else if (node.tag === HostPortal) {
                if (node.child !== null) {
                  currentParent = node.stateNode.containerInfo;
                  currentParentIsContainer = true;
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
              } else {
                commitUnmount(finishedRoot, node);
                if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
              }
              if (node === current2) {
                return;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === current2) {
                  return;
                }
                node = node.return;
                if (node.tag === HostPortal) {
                  currentParentIsValid = false;
                }
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
          }
          function commitDeletion(finishedRoot, current2, renderPriorityLevel) {
            {
              unmountHostComponents(finishedRoot, current2);
            }
            var alternate = current2.alternate;
            detachFiberMutation(current2);
            if (alternate !== null) {
              detachFiberMutation(alternate);
            }
          }
          function commitWork(current2, finishedWork) {
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case MemoComponent:
              case SimpleMemoComponent:
              case Block: {
                {
                  commitHookEffectListUnmount(Layout | HasEffect, finishedWork);
                }
                return;
              }
              case ClassComponent: {
                return;
              }
              case HostComponent: {
                var instance = finishedWork.stateNode;
                if (instance != null) {
                  var newProps = finishedWork.memoizedProps;
                  var oldProps = current2 !== null ? current2.memoizedProps : newProps;
                  var type = finishedWork.type;
                  var updatePayload = finishedWork.updateQueue;
                  finishedWork.updateQueue = null;
                  if (updatePayload !== null) {
                    commitUpdate(instance, updatePayload, type, oldProps, newProps);
                  }
                }
                return;
              }
              case HostText: {
                if (!(finishedWork.stateNode !== null)) {
                  {
                    throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
                  }
                }
                var textInstance = finishedWork.stateNode;
                var newText = finishedWork.memoizedProps;
                var oldText = current2 !== null ? current2.memoizedProps : newText;
                commitTextUpdate(textInstance, oldText, newText);
                return;
              }
              case HostRoot: {
                {
                  var _root = finishedWork.stateNode;
                  if (_root.hydrate) {
                    _root.hydrate = false;
                    commitHydratedContainer(_root.containerInfo);
                  }
                }
                return;
              }
              case Profiler: {
                return;
              }
              case SuspenseComponent: {
                commitSuspenseComponent(finishedWork);
                attachSuspenseRetryListeners(finishedWork);
                return;
              }
              case SuspenseListComponent: {
                attachSuspenseRetryListeners(finishedWork);
                return;
              }
              case IncompleteClassComponent: {
                return;
              }
              case FundamentalComponent: {
                break;
              }
              case ScopeComponent: {
                break;
              }
              case OffscreenComponent:
              case LegacyHiddenComponent: {
                var newState = finishedWork.memoizedState;
                var isHidden = newState !== null;
                hideOrUnhideAllChildren(finishedWork, isHidden);
                return;
              }
            }
            {
              {
                throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function commitSuspenseComponent(finishedWork) {
            var newState = finishedWork.memoizedState;
            if (newState !== null) {
              markCommitTimeOfFallback();
              {
                var primaryChildParent = finishedWork.child;
                hideOrUnhideAllChildren(primaryChildParent, true);
              }
            }
          }
          function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
            var newState = finishedWork.memoizedState;
            if (newState === null) {
              var current2 = finishedWork.alternate;
              if (current2 !== null) {
                var prevState = current2.memoizedState;
                if (prevState !== null) {
                  var suspenseInstance = prevState.dehydrated;
                  if (suspenseInstance !== null) {
                    commitHydratedSuspenseInstance(suspenseInstance);
                  }
                }
              }
            }
          }
          function attachSuspenseRetryListeners(finishedWork) {
            var wakeables = finishedWork.updateQueue;
            if (wakeables !== null) {
              finishedWork.updateQueue = null;
              var retryCache = finishedWork.stateNode;
              if (retryCache === null) {
                retryCache = finishedWork.stateNode = new PossiblyWeakSet();
              }
              wakeables.forEach(function(wakeable) {
                var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
                if (!retryCache.has(wakeable)) {
                  {
                    if (wakeable.__reactDoNotTraceInteractions !== true) {
                      retry = tracing.unstable_wrap(retry);
                    }
                  }
                  retryCache.add(wakeable);
                  wakeable.then(retry, retry);
                }
              });
            }
          }
          function isSuspenseBoundaryBeingHidden(current2, finishedWork) {
            if (current2 !== null) {
              var oldState = current2.memoizedState;
              if (oldState === null || oldState.dehydrated !== null) {
                var newState = finishedWork.memoizedState;
                return newState !== null && newState.dehydrated === null;
              }
            }
            return false;
          }
          function commitResetTextContent(current2) {
            resetTextContent(current2.stateNode);
          }
          var COMPONENT_TYPE = 0;
          var HAS_PSEUDO_CLASS_TYPE = 1;
          var ROLE_TYPE = 2;
          var TEST_NAME_TYPE = 3;
          var TEXT_TYPE = 4;
          if (typeof Symbol === "function" && Symbol.for) {
            var symbolFor$1 = Symbol.for;
            COMPONENT_TYPE = symbolFor$1("selector.component");
            HAS_PSEUDO_CLASS_TYPE = symbolFor$1("selector.has_pseudo_class");
            ROLE_TYPE = symbolFor$1("selector.role");
            TEST_NAME_TYPE = symbolFor$1("selector.test_id");
            TEXT_TYPE = symbolFor$1("selector.text");
          }
          var commitHooks = [];
          function onCommitRoot$1() {
            {
              commitHooks.forEach(function(commitHook) {
                return commitHook();
              });
            }
          }
          var ceil = Math.ceil;
          var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;
          var NoContext = 0;
          var BatchedContext = 1;
          var EventContext = 2;
          var DiscreteEventContext = 4;
          var LegacyUnbatchedContext = 8;
          var RenderContext = 16;
          var CommitContext = 32;
          var RetryAfterError = 64;
          var RootIncomplete = 0;
          var RootFatalErrored = 1;
          var RootErrored = 2;
          var RootSuspended = 3;
          var RootSuspendedWithDelay = 4;
          var RootCompleted = 5;
          var executionContext = NoContext;
          var workInProgressRoot = null;
          var workInProgress = null;
          var workInProgressRootRenderLanes = NoLanes;
          var subtreeRenderLanes = NoLanes;
          var subtreeRenderLanesCursor = createCursor(NoLanes);
          var workInProgressRootExitStatus = RootIncomplete;
          var workInProgressRootFatalError = null;
          var workInProgressRootIncludedLanes = NoLanes;
          var workInProgressRootSkippedLanes = NoLanes;
          var workInProgressRootUpdatedLanes = NoLanes;
          var workInProgressRootPingedLanes = NoLanes;
          var mostRecentlyUpdatedRoot = null;
          var globalMostRecentFallbackTime = 0;
          var FALLBACK_THROTTLE_MS = 500;
          var workInProgressRootRenderTargetTime = Infinity;
          var RENDER_TIMEOUT_MS = 500;
          function resetRenderTimer() {
            workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS;
          }
          function getRenderTargetTime() {
            return workInProgressRootRenderTargetTime;
          }
          var nextEffect = null;
          var hasUncaughtError = false;
          var firstUncaughtError = null;
          var legacyErrorBoundariesThatAlreadyFailed = null;
          var rootDoesHavePassiveEffects = false;
          var rootWithPendingPassiveEffects = null;
          var pendingPassiveEffectsRenderPriority = NoPriority$1;
          var pendingPassiveEffectsLanes = NoLanes;
          var pendingPassiveHookEffectsMount = [];
          var pendingPassiveHookEffectsUnmount = [];
          var rootsWithPendingDiscreteUpdates = null;
          var NESTED_UPDATE_LIMIT = 50;
          var nestedUpdateCount = 0;
          var rootWithNestedUpdates = null;
          var NESTED_PASSIVE_UPDATE_LIMIT = 50;
          var nestedPassiveUpdateCount = 0;
          var spawnedWorkDuringRender = null;
          var currentEventTime = NoTimestamp;
          var currentEventWipLanes = NoLanes;
          var currentEventPendingLanes = NoLanes;
          var isFlushingPassiveEffects = false;
          var focusedInstanceHandle = null;
          var shouldFireAfterActiveInstanceBlur = false;
          function getWorkInProgressRoot() {
            return workInProgressRoot;
          }
          function requestEventTime() {
            if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
              return now();
            }
            if (currentEventTime !== NoTimestamp) {
              return currentEventTime;
            }
            currentEventTime = now();
            return currentEventTime;
          }
          function requestUpdateLane(fiber) {
            var mode = fiber.mode;
            if ((mode & BlockingMode) === NoMode) {
              return SyncLane;
            } else if ((mode & ConcurrentMode) === NoMode) {
              return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;
            }
            if (currentEventWipLanes === NoLanes) {
              currentEventWipLanes = workInProgressRootIncludedLanes;
            }
            var isTransition = requestCurrentTransition() !== NoTransition;
            if (isTransition) {
              if (currentEventPendingLanes !== NoLanes) {
                currentEventPendingLanes = mostRecentlyUpdatedRoot !== null ? mostRecentlyUpdatedRoot.pendingLanes : NoLanes;
              }
              return findTransitionLane(currentEventWipLanes, currentEventPendingLanes);
            }
            var schedulerPriority = getCurrentPriorityLevel();
            var lane;
            if ((executionContext & DiscreteEventContext) !== NoContext && schedulerPriority === UserBlockingPriority$2) {
              lane = findUpdateLane(InputDiscreteLanePriority, currentEventWipLanes);
            } else {
              var schedulerLanePriority = schedulerPriorityToLanePriority(schedulerPriority);
              lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes);
            }
            return lane;
          }
          function requestRetryLane(fiber) {
            var mode = fiber.mode;
            if ((mode & BlockingMode) === NoMode) {
              return SyncLane;
            } else if ((mode & ConcurrentMode) === NoMode) {
              return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;
            }
            if (currentEventWipLanes === NoLanes) {
              currentEventWipLanes = workInProgressRootIncludedLanes;
            }
            return findRetryLane(currentEventWipLanes);
          }
          function scheduleUpdateOnFiber(fiber, lane, eventTime) {
            checkForNestedUpdates();
            warnAboutRenderPhaseUpdatesInDEV(fiber);
            var root2 = markUpdateLaneFromFiberToRoot(fiber, lane);
            if (root2 === null) {
              warnAboutUpdateOnUnmountedFiberInDEV(fiber);
              return null;
            }
            markRootUpdated(root2, lane, eventTime);
            if (root2 === workInProgressRoot) {
              {
                workInProgressRootUpdatedLanes = mergeLanes(workInProgressRootUpdatedLanes, lane);
              }
              if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
                markRootSuspended$1(root2, workInProgressRootRenderLanes);
              }
            }
            var priorityLevel = getCurrentPriorityLevel();
            if (lane === SyncLane) {
              if ((executionContext & LegacyUnbatchedContext) !== NoContext && (executionContext & (RenderContext | CommitContext)) === NoContext) {
                schedulePendingInteractions(root2, lane);
                performSyncWorkOnRoot(root2);
              } else {
                ensureRootIsScheduled(root2, eventTime);
                schedulePendingInteractions(root2, lane);
                if (executionContext === NoContext) {
                  resetRenderTimer();
                  flushSyncCallbackQueue();
                }
              }
            } else {
              if ((executionContext & DiscreteEventContext) !== NoContext && (priorityLevel === UserBlockingPriority$2 || priorityLevel === ImmediatePriority$1)) {
                if (rootsWithPendingDiscreteUpdates === null) {
                  rootsWithPendingDiscreteUpdates = /* @__PURE__ */ new Set([root2]);
                } else {
                  rootsWithPendingDiscreteUpdates.add(root2);
                }
              }
              ensureRootIsScheduled(root2, eventTime);
              schedulePendingInteractions(root2, lane);
            }
            mostRecentlyUpdatedRoot = root2;
          }
          function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
            sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);
            var alternate = sourceFiber.alternate;
            if (alternate !== null) {
              alternate.lanes = mergeLanes(alternate.lanes, lane);
            }
            {
              if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {
                warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
              }
            }
            var node = sourceFiber;
            var parent = sourceFiber.return;
            while (parent !== null) {
              parent.childLanes = mergeLanes(parent.childLanes, lane);
              alternate = parent.alternate;
              if (alternate !== null) {
                alternate.childLanes = mergeLanes(alternate.childLanes, lane);
              } else {
                {
                  if ((parent.flags & (Placement | Hydrating)) !== NoFlags) {
                    warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
                  }
                }
              }
              node = parent;
              parent = parent.return;
            }
            if (node.tag === HostRoot) {
              var root2 = node.stateNode;
              return root2;
            } else {
              return null;
            }
          }
          function ensureRootIsScheduled(root2, currentTime) {
            var existingCallbackNode = root2.callbackNode;
            markStarvedLanesAsExpired(root2, currentTime);
            var nextLanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
            var newCallbackPriority = returnNextLanesPriority();
            if (nextLanes === NoLanes) {
              if (existingCallbackNode !== null) {
                cancelCallback(existingCallbackNode);
                root2.callbackNode = null;
                root2.callbackPriority = NoLanePriority;
              }
              return;
            }
            if (existingCallbackNode !== null) {
              var existingCallbackPriority = root2.callbackPriority;
              if (existingCallbackPriority === newCallbackPriority) {
                return;
              }
              cancelCallback(existingCallbackNode);
            }
            var newCallbackNode;
            if (newCallbackPriority === SyncLanePriority) {
              newCallbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root2));
            } else if (newCallbackPriority === SyncBatchedLanePriority) {
              newCallbackNode = scheduleCallback(ImmediatePriority$1, performSyncWorkOnRoot.bind(null, root2));
            } else {
              var schedulerPriorityLevel = lanePriorityToSchedulerPriority(newCallbackPriority);
              newCallbackNode = scheduleCallback(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root2));
            }
            root2.callbackPriority = newCallbackPriority;
            root2.callbackNode = newCallbackNode;
          }
          function performConcurrentWorkOnRoot(root2) {
            currentEventTime = NoTimestamp;
            currentEventWipLanes = NoLanes;
            currentEventPendingLanes = NoLanes;
            if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
              {
                throw Error("Should not already be working.");
              }
            }
            var originalCallbackNode = root2.callbackNode;
            var didFlushPassiveEffects = flushPassiveEffects();
            if (didFlushPassiveEffects) {
              if (root2.callbackNode !== originalCallbackNode) {
                return null;
              }
            }
            var lanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
            if (lanes === NoLanes) {
              return null;
            }
            var exitStatus = renderRootConcurrent(root2, lanes);
            if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {
              prepareFreshStack(root2, NoLanes);
            } else if (exitStatus !== RootIncomplete) {
              if (exitStatus === RootErrored) {
                executionContext |= RetryAfterError;
                if (root2.hydrate) {
                  root2.hydrate = false;
                  clearContainer(root2.containerInfo);
                }
                lanes = getLanesToRetrySynchronouslyOnError(root2);
                if (lanes !== NoLanes) {
                  exitStatus = renderRootSync(root2, lanes);
                }
              }
              if (exitStatus === RootFatalErrored) {
                var fatalError = workInProgressRootFatalError;
                prepareFreshStack(root2, NoLanes);
                markRootSuspended$1(root2, lanes);
                ensureRootIsScheduled(root2, now());
                throw fatalError;
              }
              var finishedWork = root2.current.alternate;
              root2.finishedWork = finishedWork;
              root2.finishedLanes = lanes;
              finishConcurrentRender(root2, exitStatus, lanes);
            }
            ensureRootIsScheduled(root2, now());
            if (root2.callbackNode === originalCallbackNode) {
              return performConcurrentWorkOnRoot.bind(null, root2);
            }
            return null;
          }
          function finishConcurrentRender(root2, exitStatus, lanes) {
            switch (exitStatus) {
              case RootIncomplete:
              case RootFatalErrored: {
                {
                  {
                    throw Error("Root did not complete. This is a bug in React.");
                  }
                }
              }
              case RootErrored: {
                commitRoot(root2);
                break;
              }
              case RootSuspended: {
                markRootSuspended$1(root2, lanes);
                if (includesOnlyRetries(lanes) && !shouldForceFlushFallbacksInDEV()) {
                  var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now();
                  if (msUntilTimeout > 10) {
                    var nextLanes = getNextLanes(root2, NoLanes);
                    if (nextLanes !== NoLanes) {
                      break;
                    }
                    var suspendedLanes = root2.suspendedLanes;
                    if (!isSubsetOfLanes(suspendedLanes, lanes)) {
                      var eventTime = requestEventTime();
                      markRootPinged(root2, suspendedLanes);
                      break;
                    }
                    root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2), msUntilTimeout);
                    break;
                  }
                }
                commitRoot(root2);
                break;
              }
              case RootSuspendedWithDelay: {
                markRootSuspended$1(root2, lanes);
                if (includesOnlyTransitions(lanes)) {
                  break;
                }
                if (!shouldForceFlushFallbacksInDEV()) {
                  var mostRecentEventTime = getMostRecentEventTime(root2, lanes);
                  var eventTimeMs = mostRecentEventTime;
                  var timeElapsedMs = now() - eventTimeMs;
                  var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs;
                  if (_msUntilTimeout > 10) {
                    root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2), _msUntilTimeout);
                    break;
                  }
                }
                commitRoot(root2);
                break;
              }
              case RootCompleted: {
                commitRoot(root2);
                break;
              }
              default: {
                {
                  {
                    throw Error("Unknown root exit status.");
                  }
                }
              }
            }
          }
          function markRootSuspended$1(root2, suspendedLanes) {
            suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
            suspendedLanes = removeLanes(suspendedLanes, workInProgressRootUpdatedLanes);
            markRootSuspended(root2, suspendedLanes);
          }
          function performSyncWorkOnRoot(root2) {
            if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
              {
                throw Error("Should not already be working.");
              }
            }
            flushPassiveEffects();
            var lanes;
            var exitStatus;
            if (root2 === workInProgressRoot && includesSomeLane(root2.expiredLanes, workInProgressRootRenderLanes)) {
              lanes = workInProgressRootRenderLanes;
              exitStatus = renderRootSync(root2, lanes);
              if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {
                lanes = getNextLanes(root2, lanes);
                exitStatus = renderRootSync(root2, lanes);
              }
            } else {
              lanes = getNextLanes(root2, NoLanes);
              exitStatus = renderRootSync(root2, lanes);
            }
            if (root2.tag !== LegacyRoot && exitStatus === RootErrored) {
              executionContext |= RetryAfterError;
              if (root2.hydrate) {
                root2.hydrate = false;
                clearContainer(root2.containerInfo);
              }
              lanes = getLanesToRetrySynchronouslyOnError(root2);
              if (lanes !== NoLanes) {
                exitStatus = renderRootSync(root2, lanes);
              }
            }
            if (exitStatus === RootFatalErrored) {
              var fatalError = workInProgressRootFatalError;
              prepareFreshStack(root2, NoLanes);
              markRootSuspended$1(root2, lanes);
              ensureRootIsScheduled(root2, now());
              throw fatalError;
            }
            var finishedWork = root2.current.alternate;
            root2.finishedWork = finishedWork;
            root2.finishedLanes = lanes;
            commitRoot(root2);
            ensureRootIsScheduled(root2, now());
            return null;
          }
          function flushDiscreteUpdates() {
            if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {
              {
                if ((executionContext & RenderContext) !== NoContext) {
                  error("unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.");
                }
              }
              return;
            }
            flushPendingDiscreteUpdates();
            flushPassiveEffects();
          }
          function flushPendingDiscreteUpdates() {
            if (rootsWithPendingDiscreteUpdates !== null) {
              var roots = rootsWithPendingDiscreteUpdates;
              rootsWithPendingDiscreteUpdates = null;
              roots.forEach(function(root2) {
                markDiscreteUpdatesExpired(root2);
                ensureRootIsScheduled(root2, now());
              });
            }
            flushSyncCallbackQueue();
          }
          function batchedUpdates$1(fn, a) {
            var prevExecutionContext = executionContext;
            executionContext |= BatchedContext;
            try {
              return fn(a);
            } finally {
              executionContext = prevExecutionContext;
              if (executionContext === NoContext) {
                resetRenderTimer();
                flushSyncCallbackQueue();
              }
            }
          }
          function batchedEventUpdates$1(fn, a) {
            var prevExecutionContext = executionContext;
            executionContext |= EventContext;
            try {
              return fn(a);
            } finally {
              executionContext = prevExecutionContext;
              if (executionContext === NoContext) {
                resetRenderTimer();
                flushSyncCallbackQueue();
              }
            }
          }
          function discreteUpdates$1(fn, a, b, c, d) {
            var prevExecutionContext = executionContext;
            executionContext |= DiscreteEventContext;
            {
              try {
                return runWithPriority$1(UserBlockingPriority$2, fn.bind(null, a, b, c, d));
              } finally {
                executionContext = prevExecutionContext;
                if (executionContext === NoContext) {
                  resetRenderTimer();
                  flushSyncCallbackQueue();
                }
              }
            }
          }
          function unbatchedUpdates(fn, a) {
            var prevExecutionContext = executionContext;
            executionContext &= ~BatchedContext;
            executionContext |= LegacyUnbatchedContext;
            try {
              return fn(a);
            } finally {
              executionContext = prevExecutionContext;
              if (executionContext === NoContext) {
                resetRenderTimer();
                flushSyncCallbackQueue();
              }
            }
          }
          function flushSync(fn, a) {
            var prevExecutionContext = executionContext;
            if ((prevExecutionContext & (RenderContext | CommitContext)) !== NoContext) {
              {
                error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.");
              }
              return fn(a);
            }
            executionContext |= BatchedContext;
            {
              try {
                if (fn) {
                  return runWithPriority$1(ImmediatePriority$1, fn.bind(null, a));
                } else {
                  return void 0;
                }
              } finally {
                executionContext = prevExecutionContext;
                flushSyncCallbackQueue();
              }
            }
          }
          function pushRenderLanes(fiber, lanes) {
            push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);
            subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes);
            workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes);
          }
          function popRenderLanes(fiber) {
            subtreeRenderLanes = subtreeRenderLanesCursor.current;
            pop(subtreeRenderLanesCursor, fiber);
          }
          function prepareFreshStack(root2, lanes) {
            root2.finishedWork = null;
            root2.finishedLanes = NoLanes;
            var timeoutHandle = root2.timeoutHandle;
            if (timeoutHandle !== noTimeout) {
              root2.timeoutHandle = noTimeout;
              cancelTimeout(timeoutHandle);
            }
            if (workInProgress !== null) {
              var interruptedWork = workInProgress.return;
              while (interruptedWork !== null) {
                unwindInterruptedWork(interruptedWork);
                interruptedWork = interruptedWork.return;
              }
            }
            workInProgressRoot = root2;
            workInProgress = createWorkInProgress(root2.current, null);
            workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;
            workInProgressRootExitStatus = RootIncomplete;
            workInProgressRootFatalError = null;
            workInProgressRootSkippedLanes = NoLanes;
            workInProgressRootUpdatedLanes = NoLanes;
            workInProgressRootPingedLanes = NoLanes;
            {
              spawnedWorkDuringRender = null;
            }
            {
              ReactStrictModeWarnings.discardPendingWarnings();
            }
          }
          function handleError(root2, thrownValue) {
            do {
              var erroredWork = workInProgress;
              try {
                resetContextDependencies();
                resetHooksAfterThrow();
                resetCurrentFiber();
                ReactCurrentOwner$2.current = null;
                if (erroredWork === null || erroredWork.return === null) {
                  workInProgressRootExitStatus = RootFatalErrored;
                  workInProgressRootFatalError = thrownValue;
                  workInProgress = null;
                  return;
                }
                if (enableProfilerTimer && erroredWork.mode & ProfileMode) {
                  stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);
                }
                throwException(root2, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes);
                completeUnitOfWork(erroredWork);
              } catch (yetAnotherThrownValue) {
                thrownValue = yetAnotherThrownValue;
                if (workInProgress === erroredWork && erroredWork !== null) {
                  erroredWork = erroredWork.return;
                  workInProgress = erroredWork;
                } else {
                  erroredWork = workInProgress;
                }
                continue;
              }
              return;
            } while (true);
          }
          function pushDispatcher() {
            var prevDispatcher = ReactCurrentDispatcher$2.current;
            ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;
            if (prevDispatcher === null) {
              return ContextOnlyDispatcher;
            } else {
              return prevDispatcher;
            }
          }
          function popDispatcher(prevDispatcher) {
            ReactCurrentDispatcher$2.current = prevDispatcher;
          }
          function pushInteractions(root2) {
            {
              var prevInteractions = tracing.__interactionsRef.current;
              tracing.__interactionsRef.current = root2.memoizedInteractions;
              return prevInteractions;
            }
          }
          function popInteractions(prevInteractions) {
            {
              tracing.__interactionsRef.current = prevInteractions;
            }
          }
          function markCommitTimeOfFallback() {
            globalMostRecentFallbackTime = now();
          }
          function markSkippedUpdateLanes(lane) {
            workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);
          }
          function renderDidSuspend() {
            if (workInProgressRootExitStatus === RootIncomplete) {
              workInProgressRootExitStatus = RootSuspended;
            }
          }
          function renderDidSuspendDelayIfPossible() {
            if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {
              workInProgressRootExitStatus = RootSuspendedWithDelay;
            }
            if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootUpdatedLanes))) {
              markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);
            }
          }
          function renderDidError() {
            if (workInProgressRootExitStatus !== RootCompleted) {
              workInProgressRootExitStatus = RootErrored;
            }
          }
          function renderHasNotSuspendedYet() {
            return workInProgressRootExitStatus === RootIncomplete;
          }
          function renderRootSync(root2, lanes) {
            var prevExecutionContext = executionContext;
            executionContext |= RenderContext;
            var prevDispatcher = pushDispatcher();
            if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
              prepareFreshStack(root2, lanes);
              startWorkOnPendingInteractions(root2, lanes);
            }
            var prevInteractions = pushInteractions(root2);
            do {
              try {
                workLoopSync();
                break;
              } catch (thrownValue) {
                handleError(root2, thrownValue);
              }
            } while (true);
            resetContextDependencies();
            {
              popInteractions(prevInteractions);
            }
            executionContext = prevExecutionContext;
            popDispatcher(prevDispatcher);
            if (workInProgress !== null) {
              {
                {
                  throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
            }
            workInProgressRoot = null;
            workInProgressRootRenderLanes = NoLanes;
            return workInProgressRootExitStatus;
          }
          function workLoopSync() {
            while (workInProgress !== null) {
              performUnitOfWork(workInProgress);
            }
          }
          function renderRootConcurrent(root2, lanes) {
            var prevExecutionContext = executionContext;
            executionContext |= RenderContext;
            var prevDispatcher = pushDispatcher();
            if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
              resetRenderTimer();
              prepareFreshStack(root2, lanes);
              startWorkOnPendingInteractions(root2, lanes);
            }
            var prevInteractions = pushInteractions(root2);
            do {
              try {
                workLoopConcurrent();
                break;
              } catch (thrownValue) {
                handleError(root2, thrownValue);
              }
            } while (true);
            resetContextDependencies();
            {
              popInteractions(prevInteractions);
            }
            popDispatcher(prevDispatcher);
            executionContext = prevExecutionContext;
            if (workInProgress !== null) {
              return RootIncomplete;
            } else {
              workInProgressRoot = null;
              workInProgressRootRenderLanes = NoLanes;
              return workInProgressRootExitStatus;
            }
          }
          function workLoopConcurrent() {
            while (workInProgress !== null && !shouldYield()) {
              performUnitOfWork(workInProgress);
            }
          }
          function performUnitOfWork(unitOfWork) {
            var current2 = unitOfWork.alternate;
            setCurrentFiber(unitOfWork);
            var next;
            if ((unitOfWork.mode & ProfileMode) !== NoMode) {
              startProfilerTimer(unitOfWork);
              next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
              stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
            } else {
              next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
            }
            resetCurrentFiber();
            unitOfWork.memoizedProps = unitOfWork.pendingProps;
            if (next === null) {
              completeUnitOfWork(unitOfWork);
            } else {
              workInProgress = next;
            }
            ReactCurrentOwner$2.current = null;
          }
          function completeUnitOfWork(unitOfWork) {
            var completedWork = unitOfWork;
            do {
              var current2 = completedWork.alternate;
              var returnFiber = completedWork.return;
              if ((completedWork.flags & Incomplete) === NoFlags) {
                setCurrentFiber(completedWork);
                var next = void 0;
                if ((completedWork.mode & ProfileMode) === NoMode) {
                  next = completeWork(current2, completedWork, subtreeRenderLanes);
                } else {
                  startProfilerTimer(completedWork);
                  next = completeWork(current2, completedWork, subtreeRenderLanes);
                  stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
                }
                resetCurrentFiber();
                if (next !== null) {
                  workInProgress = next;
                  return;
                }
                resetChildLanes(completedWork);
                if (returnFiber !== null && (returnFiber.flags & Incomplete) === NoFlags) {
                  if (returnFiber.firstEffect === null) {
                    returnFiber.firstEffect = completedWork.firstEffect;
                  }
                  if (completedWork.lastEffect !== null) {
                    if (returnFiber.lastEffect !== null) {
                      returnFiber.lastEffect.nextEffect = completedWork.firstEffect;
                    }
                    returnFiber.lastEffect = completedWork.lastEffect;
                  }
                  var flags = completedWork.flags;
                  if (flags > PerformedWork) {
                    if (returnFiber.lastEffect !== null) {
                      returnFiber.lastEffect.nextEffect = completedWork;
                    } else {
                      returnFiber.firstEffect = completedWork;
                    }
                    returnFiber.lastEffect = completedWork;
                  }
                }
              } else {
                var _next = unwindWork(completedWork);
                if (_next !== null) {
                  _next.flags &= HostEffectMask;
                  workInProgress = _next;
                  return;
                }
                if ((completedWork.mode & ProfileMode) !== NoMode) {
                  stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
                  var actualDuration = completedWork.actualDuration;
                  var child = completedWork.child;
                  while (child !== null) {
                    actualDuration += child.actualDuration;
                    child = child.sibling;
                  }
                  completedWork.actualDuration = actualDuration;
                }
                if (returnFiber !== null) {
                  returnFiber.firstEffect = returnFiber.lastEffect = null;
                  returnFiber.flags |= Incomplete;
                }
              }
              var siblingFiber = completedWork.sibling;
              if (siblingFiber !== null) {
                workInProgress = siblingFiber;
                return;
              }
              completedWork = returnFiber;
              workInProgress = completedWork;
            } while (completedWork !== null);
            if (workInProgressRootExitStatus === RootIncomplete) {
              workInProgressRootExitStatus = RootCompleted;
            }
          }
          function resetChildLanes(completedWork) {
            if ((completedWork.tag === LegacyHiddenComponent || completedWork.tag === OffscreenComponent) && completedWork.memoizedState !== null && !includesSomeLane(subtreeRenderLanes, OffscreenLane) && (completedWork.mode & ConcurrentMode) !== NoLanes) {
              return;
            }
            var newChildLanes = NoLanes;
            if ((completedWork.mode & ProfileMode) !== NoMode) {
              var actualDuration = completedWork.actualDuration;
              var treeBaseDuration = completedWork.selfBaseDuration;
              var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;
              var child = completedWork.child;
              while (child !== null) {
                newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));
                if (shouldBubbleActualDurations) {
                  actualDuration += child.actualDuration;
                }
                treeBaseDuration += child.treeBaseDuration;
                child = child.sibling;
              }
              var isTimedOutSuspense = completedWork.tag === SuspenseComponent && completedWork.memoizedState !== null;
              if (isTimedOutSuspense) {
                var primaryChildFragment = completedWork.child;
                if (primaryChildFragment !== null) {
                  treeBaseDuration -= primaryChildFragment.treeBaseDuration;
                }
              }
              completedWork.actualDuration = actualDuration;
              completedWork.treeBaseDuration = treeBaseDuration;
            } else {
              var _child = completedWork.child;
              while (_child !== null) {
                newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));
                _child = _child.sibling;
              }
            }
            completedWork.childLanes = newChildLanes;
          }
          function commitRoot(root2) {
            var renderPriorityLevel = getCurrentPriorityLevel();
            runWithPriority$1(ImmediatePriority$1, commitRootImpl.bind(null, root2, renderPriorityLevel));
            return null;
          }
          function commitRootImpl(root2, renderPriorityLevel) {
            do {
              flushPassiveEffects();
            } while (rootWithPendingPassiveEffects !== null);
            flushRenderPhaseStrictModeWarningsInDEV();
            if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
              {
                throw Error("Should not already be working.");
              }
            }
            var finishedWork = root2.finishedWork;
            var lanes = root2.finishedLanes;
            if (finishedWork === null) {
              return null;
            }
            root2.finishedWork = null;
            root2.finishedLanes = NoLanes;
            if (!(finishedWork !== root2.current)) {
              {
                throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            root2.callbackNode = null;
            var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);
            markRootFinished(root2, remainingLanes);
            if (rootsWithPendingDiscreteUpdates !== null) {
              if (!hasDiscreteLanes(remainingLanes) && rootsWithPendingDiscreteUpdates.has(root2)) {
                rootsWithPendingDiscreteUpdates.delete(root2);
              }
            }
            if (root2 === workInProgressRoot) {
              workInProgressRoot = null;
              workInProgress = null;
              workInProgressRootRenderLanes = NoLanes;
            }
            var firstEffect;
            if (finishedWork.flags > PerformedWork) {
              if (finishedWork.lastEffect !== null) {
                finishedWork.lastEffect.nextEffect = finishedWork;
                firstEffect = finishedWork.firstEffect;
              } else {
                firstEffect = finishedWork;
              }
            } else {
              firstEffect = finishedWork.firstEffect;
            }
            if (firstEffect !== null) {
              var prevExecutionContext = executionContext;
              executionContext |= CommitContext;
              var prevInteractions = pushInteractions(root2);
              ReactCurrentOwner$2.current = null;
              focusedInstanceHandle = prepareForCommit(root2.containerInfo);
              shouldFireAfterActiveInstanceBlur = false;
              nextEffect = firstEffect;
              do {
                {
                  invokeGuardedCallback(null, commitBeforeMutationEffects, null);
                  if (hasCaughtError()) {
                    if (!(nextEffect !== null)) {
                      {
                        throw Error("Should be working on an effect.");
                      }
                    }
                    var error2 = clearCaughtError();
                    captureCommitPhaseError(nextEffect, error2);
                    nextEffect = nextEffect.nextEffect;
                  }
                }
              } while (nextEffect !== null);
              focusedInstanceHandle = null;
              {
                recordCommitTime();
              }
              nextEffect = firstEffect;
              do {
                {
                  invokeGuardedCallback(null, commitMutationEffects, null, root2, renderPriorityLevel);
                  if (hasCaughtError()) {
                    if (!(nextEffect !== null)) {
                      {
                        throw Error("Should be working on an effect.");
                      }
                    }
                    var _error = clearCaughtError();
                    captureCommitPhaseError(nextEffect, _error);
                    nextEffect = nextEffect.nextEffect;
                  }
                }
              } while (nextEffect !== null);
              resetAfterCommit(root2.containerInfo);
              root2.current = finishedWork;
              nextEffect = firstEffect;
              do {
                {
                  invokeGuardedCallback(null, commitLayoutEffects, null, root2, lanes);
                  if (hasCaughtError()) {
                    if (!(nextEffect !== null)) {
                      {
                        throw Error("Should be working on an effect.");
                      }
                    }
                    var _error2 = clearCaughtError();
                    captureCommitPhaseError(nextEffect, _error2);
                    nextEffect = nextEffect.nextEffect;
                  }
                }
              } while (nextEffect !== null);
              nextEffect = null;
              requestPaint();
              {
                popInteractions(prevInteractions);
              }
              executionContext = prevExecutionContext;
            } else {
              root2.current = finishedWork;
              {
                recordCommitTime();
              }
            }
            var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
            if (rootDoesHavePassiveEffects) {
              rootDoesHavePassiveEffects = false;
              rootWithPendingPassiveEffects = root2;
              pendingPassiveEffectsLanes = lanes;
              pendingPassiveEffectsRenderPriority = renderPriorityLevel;
            } else {
              nextEffect = firstEffect;
              while (nextEffect !== null) {
                var nextNextEffect = nextEffect.nextEffect;
                nextEffect.nextEffect = null;
                if (nextEffect.flags & Deletion) {
                  detachFiberAfterEffects(nextEffect);
                }
                nextEffect = nextNextEffect;
              }
            }
            remainingLanes = root2.pendingLanes;
            if (remainingLanes !== NoLanes) {
              {
                if (spawnedWorkDuringRender !== null) {
                  var expirationTimes = spawnedWorkDuringRender;
                  spawnedWorkDuringRender = null;
                  for (var i = 0; i < expirationTimes.length; i++) {
                    scheduleInteractions(root2, expirationTimes[i], root2.memoizedInteractions);
                  }
                }
                schedulePendingInteractions(root2, remainingLanes);
              }
            } else {
              legacyErrorBoundariesThatAlreadyFailed = null;
            }
            {
              if (!rootDidHavePassiveEffects) {
                finishPendingInteractions(root2, lanes);
              }
            }
            if (remainingLanes === SyncLane) {
              if (root2 === rootWithNestedUpdates) {
                nestedUpdateCount++;
              } else {
                nestedUpdateCount = 0;
                rootWithNestedUpdates = root2;
              }
            } else {
              nestedUpdateCount = 0;
            }
            onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
            {
              onCommitRoot$1();
            }
            ensureRootIsScheduled(root2, now());
            if (hasUncaughtError) {
              hasUncaughtError = false;
              var _error3 = firstUncaughtError;
              firstUncaughtError = null;
              throw _error3;
            }
            if ((executionContext & LegacyUnbatchedContext) !== NoContext) {
              return null;
            }
            flushSyncCallbackQueue();
            return null;
          }
          function commitBeforeMutationEffects() {
            while (nextEffect !== null) {
              var current2 = nextEffect.alternate;
              if (!shouldFireAfterActiveInstanceBlur && focusedInstanceHandle !== null) {
                if ((nextEffect.flags & Deletion) !== NoFlags) {
                  if (doesFiberContain(nextEffect, focusedInstanceHandle)) {
                    shouldFireAfterActiveInstanceBlur = true;
                  }
                } else {
                  if (nextEffect.tag === SuspenseComponent && isSuspenseBoundaryBeingHidden(current2, nextEffect) && doesFiberContain(nextEffect, focusedInstanceHandle)) {
                    shouldFireAfterActiveInstanceBlur = true;
                  }
                }
              }
              var flags = nextEffect.flags;
              if ((flags & Snapshot) !== NoFlags) {
                setCurrentFiber(nextEffect);
                commitBeforeMutationLifeCycles(current2, nextEffect);
                resetCurrentFiber();
              }
              if ((flags & Passive) !== NoFlags) {
                if (!rootDoesHavePassiveEffects) {
                  rootDoesHavePassiveEffects = true;
                  scheduleCallback(NormalPriority$1, function() {
                    flushPassiveEffects();
                    return null;
                  });
                }
              }
              nextEffect = nextEffect.nextEffect;
            }
          }
          function commitMutationEffects(root2, renderPriorityLevel) {
            while (nextEffect !== null) {
              setCurrentFiber(nextEffect);
              var flags = nextEffect.flags;
              if (flags & ContentReset) {
                commitResetTextContent(nextEffect);
              }
              if (flags & Ref) {
                var current2 = nextEffect.alternate;
                if (current2 !== null) {
                  commitDetachRef(current2);
                }
              }
              var primaryFlags = flags & (Placement | Update | Deletion | Hydrating);
              switch (primaryFlags) {
                case Placement: {
                  commitPlacement(nextEffect);
                  nextEffect.flags &= ~Placement;
                  break;
                }
                case PlacementAndUpdate: {
                  commitPlacement(nextEffect);
                  nextEffect.flags &= ~Placement;
                  var _current = nextEffect.alternate;
                  commitWork(_current, nextEffect);
                  break;
                }
                case Hydrating: {
                  nextEffect.flags &= ~Hydrating;
                  break;
                }
                case HydratingAndUpdate: {
                  nextEffect.flags &= ~Hydrating;
                  var _current2 = nextEffect.alternate;
                  commitWork(_current2, nextEffect);
                  break;
                }
                case Update: {
                  var _current3 = nextEffect.alternate;
                  commitWork(_current3, nextEffect);
                  break;
                }
                case Deletion: {
                  commitDeletion(root2, nextEffect);
                  break;
                }
              }
              resetCurrentFiber();
              nextEffect = nextEffect.nextEffect;
            }
          }
          function commitLayoutEffects(root2, committedLanes) {
            while (nextEffect !== null) {
              setCurrentFiber(nextEffect);
              var flags = nextEffect.flags;
              if (flags & (Update | Callback)) {
                var current2 = nextEffect.alternate;
                commitLifeCycles(root2, current2, nextEffect);
              }
              {
                if (flags & Ref) {
                  commitAttachRef(nextEffect);
                }
              }
              resetCurrentFiber();
              nextEffect = nextEffect.nextEffect;
            }
          }
          function flushPassiveEffects() {
            if (pendingPassiveEffectsRenderPriority !== NoPriority$1) {
              var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority$1 ? NormalPriority$1 : pendingPassiveEffectsRenderPriority;
              pendingPassiveEffectsRenderPriority = NoPriority$1;
              {
                return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl);
              }
            }
            return false;
          }
          function enqueuePendingPassiveHookEffectMount(fiber, effect) {
            pendingPassiveHookEffectsMount.push(effect, fiber);
            if (!rootDoesHavePassiveEffects) {
              rootDoesHavePassiveEffects = true;
              scheduleCallback(NormalPriority$1, function() {
                flushPassiveEffects();
                return null;
              });
            }
          }
          function enqueuePendingPassiveHookEffectUnmount(fiber, effect) {
            pendingPassiveHookEffectsUnmount.push(effect, fiber);
            {
              fiber.flags |= PassiveUnmountPendingDev;
              var alternate = fiber.alternate;
              if (alternate !== null) {
                alternate.flags |= PassiveUnmountPendingDev;
              }
            }
            if (!rootDoesHavePassiveEffects) {
              rootDoesHavePassiveEffects = true;
              scheduleCallback(NormalPriority$1, function() {
                flushPassiveEffects();
                return null;
              });
            }
          }
          function invokePassiveEffectCreate(effect) {
            var create = effect.create;
            effect.destroy = create();
          }
          function flushPassiveEffectsImpl() {
            if (rootWithPendingPassiveEffects === null) {
              return false;
            }
            var root2 = rootWithPendingPassiveEffects;
            var lanes = pendingPassiveEffectsLanes;
            rootWithPendingPassiveEffects = null;
            pendingPassiveEffectsLanes = NoLanes;
            if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
              {
                throw Error("Cannot flush passive effects while already rendering.");
              }
            }
            {
              isFlushingPassiveEffects = true;
            }
            var prevExecutionContext = executionContext;
            executionContext |= CommitContext;
            var prevInteractions = pushInteractions(root2);
            var unmountEffects = pendingPassiveHookEffectsUnmount;
            pendingPassiveHookEffectsUnmount = [];
            for (var i = 0; i < unmountEffects.length; i += 2) {
              var _effect = unmountEffects[i];
              var fiber = unmountEffects[i + 1];
              var destroy = _effect.destroy;
              _effect.destroy = void 0;
              {
                fiber.flags &= ~PassiveUnmountPendingDev;
                var alternate = fiber.alternate;
                if (alternate !== null) {
                  alternate.flags &= ~PassiveUnmountPendingDev;
                }
              }
              if (typeof destroy === "function") {
                {
                  setCurrentFiber(fiber);
                  {
                    invokeGuardedCallback(null, destroy, null);
                  }
                  if (hasCaughtError()) {
                    if (!(fiber !== null)) {
                      {
                        throw Error("Should be working on an effect.");
                      }
                    }
                    var error2 = clearCaughtError();
                    captureCommitPhaseError(fiber, error2);
                  }
                  resetCurrentFiber();
                }
              }
            }
            var mountEffects = pendingPassiveHookEffectsMount;
            pendingPassiveHookEffectsMount = [];
            for (var _i = 0; _i < mountEffects.length; _i += 2) {
              var _effect2 = mountEffects[_i];
              var _fiber = mountEffects[_i + 1];
              {
                setCurrentFiber(_fiber);
                {
                  invokeGuardedCallback(null, invokePassiveEffectCreate, null, _effect2);
                }
                if (hasCaughtError()) {
                  if (!(_fiber !== null)) {
                    {
                      throw Error("Should be working on an effect.");
                    }
                  }
                  var _error4 = clearCaughtError();
                  captureCommitPhaseError(_fiber, _error4);
                }
                resetCurrentFiber();
              }
            }
            var effect = root2.current.firstEffect;
            while (effect !== null) {
              var nextNextEffect = effect.nextEffect;
              effect.nextEffect = null;
              if (effect.flags & Deletion) {
                detachFiberAfterEffects(effect);
              }
              effect = nextNextEffect;
            }
            {
              popInteractions(prevInteractions);
              finishPendingInteractions(root2, lanes);
            }
            {
              isFlushingPassiveEffects = false;
            }
            executionContext = prevExecutionContext;
            flushSyncCallbackQueue();
            nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;
            return true;
          }
          function isAlreadyFailedLegacyErrorBoundary(instance) {
            return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
          }
          function markLegacyErrorBoundaryAsFailed(instance) {
            if (legacyErrorBoundariesThatAlreadyFailed === null) {
              legacyErrorBoundariesThatAlreadyFailed = /* @__PURE__ */ new Set([instance]);
            } else {
              legacyErrorBoundariesThatAlreadyFailed.add(instance);
            }
          }
          function prepareToThrowUncaughtError(error2) {
            if (!hasUncaughtError) {
              hasUncaughtError = true;
              firstUncaughtError = error2;
            }
          }
          var onUncaughtError = prepareToThrowUncaughtError;
          function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error2) {
            var errorInfo = createCapturedValue(error2, sourceFiber);
            var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);
            enqueueUpdate(rootFiber, update);
            var eventTime = requestEventTime();
            var root2 = markUpdateLaneFromFiberToRoot(rootFiber, SyncLane);
            if (root2 !== null) {
              markRootUpdated(root2, SyncLane, eventTime);
              ensureRootIsScheduled(root2, eventTime);
              schedulePendingInteractions(root2, SyncLane);
            }
          }
          function captureCommitPhaseError(sourceFiber, error2) {
            if (sourceFiber.tag === HostRoot) {
              captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error2);
              return;
            }
            var fiber = sourceFiber.return;
            while (fiber !== null) {
              if (fiber.tag === HostRoot) {
                captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error2);
                return;
              } else if (fiber.tag === ClassComponent) {
                var ctor = fiber.type;
                var instance = fiber.stateNode;
                if (typeof ctor.getDerivedStateFromError === "function" || typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) {
                  var errorInfo = createCapturedValue(error2, sourceFiber);
                  var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);
                  enqueueUpdate(fiber, update);
                  var eventTime = requestEventTime();
                  var root2 = markUpdateLaneFromFiberToRoot(fiber, SyncLane);
                  if (root2 !== null) {
                    markRootUpdated(root2, SyncLane, eventTime);
                    ensureRootIsScheduled(root2, eventTime);
                    schedulePendingInteractions(root2, SyncLane);
                  } else {
                    if (typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) {
                      try {
                        instance.componentDidCatch(error2, errorInfo);
                      } catch (errorToIgnore) {
                      }
                    }
                  }
                  return;
                }
              }
              fiber = fiber.return;
            }
          }
          function pingSuspendedRoot(root2, wakeable, pingedLanes) {
            var pingCache = root2.pingCache;
            if (pingCache !== null) {
              pingCache.delete(wakeable);
            }
            var eventTime = requestEventTime();
            markRootPinged(root2, pingedLanes);
            if (workInProgressRoot === root2 && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {
              if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
                prepareFreshStack(root2, NoLanes);
              } else {
                workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);
              }
            }
            ensureRootIsScheduled(root2, eventTime);
            schedulePendingInteractions(root2, pingedLanes);
          }
          function retryTimedOutBoundary(boundaryFiber, retryLane) {
            if (retryLane === NoLane) {
              retryLane = requestRetryLane(boundaryFiber);
            }
            var eventTime = requestEventTime();
            var root2 = markUpdateLaneFromFiberToRoot(boundaryFiber, retryLane);
            if (root2 !== null) {
              markRootUpdated(root2, retryLane, eventTime);
              ensureRootIsScheduled(root2, eventTime);
              schedulePendingInteractions(root2, retryLane);
            }
          }
          function resolveRetryWakeable(boundaryFiber, wakeable) {
            var retryLane = NoLane;
            var retryCache;
            {
              retryCache = boundaryFiber.stateNode;
            }
            if (retryCache !== null) {
              retryCache.delete(wakeable);
            }
            retryTimedOutBoundary(boundaryFiber, retryLane);
          }
          function jnd(timeElapsed) {
            return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3e3 ? 3e3 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
          }
          function checkForNestedUpdates() {
            if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
              nestedUpdateCount = 0;
              rootWithNestedUpdates = null;
              {
                {
                  throw Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");
                }
              }
            }
            {
              if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
                nestedPassiveUpdateCount = 0;
                error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.");
              }
            }
          }
          function flushRenderPhaseStrictModeWarningsInDEV() {
            {
              ReactStrictModeWarnings.flushLegacyContextWarning();
              {
                ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
              }
            }
          }
          var didWarnStateUpdateForNotYetMountedComponent = null;
          function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
            {
              if ((executionContext & RenderContext) !== NoContext) {
                return;
              }
              if (!(fiber.mode & (BlockingMode | ConcurrentMode))) {
                return;
              }
              var tag = fiber.tag;
              if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {
                return;
              }
              var componentName = getComponentName(fiber.type) || "ReactComponent";
              if (didWarnStateUpdateForNotYetMountedComponent !== null) {
                if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) {
                  return;
                }
                didWarnStateUpdateForNotYetMountedComponent.add(componentName);
              } else {
                didWarnStateUpdateForNotYetMountedComponent = /* @__PURE__ */ new Set([componentName]);
              }
              var previousFiber = current;
              try {
                setCurrentFiber(fiber);
                error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.");
              } finally {
                if (previousFiber) {
                  setCurrentFiber(fiber);
                } else {
                  resetCurrentFiber();
                }
              }
            }
          }
          var didWarnStateUpdateForUnmountedComponent = null;
          function warnAboutUpdateOnUnmountedFiberInDEV(fiber) {
            {
              var tag = fiber.tag;
              if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {
                return;
              }
              if ((fiber.flags & PassiveUnmountPendingDev) !== NoFlags) {
                return;
              }
              var componentName = getComponentName(fiber.type) || "ReactComponent";
              if (didWarnStateUpdateForUnmountedComponent !== null) {
                if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {
                  return;
                }
                didWarnStateUpdateForUnmountedComponent.add(componentName);
              } else {
                didWarnStateUpdateForUnmountedComponent = /* @__PURE__ */ new Set([componentName]);
              }
              if (isFlushingPassiveEffects)
                ;
              else {
                var previousFiber = current;
                try {
                  setCurrentFiber(fiber);
                  error("Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s.", tag === ClassComponent ? "the componentWillUnmount method" : "a useEffect cleanup function");
                } finally {
                  if (previousFiber) {
                    setCurrentFiber(fiber);
                  } else {
                    resetCurrentFiber();
                  }
                }
              }
            }
          }
          var beginWork$1;
          {
            var dummyFiber = null;
            beginWork$1 = function(current2, unitOfWork, lanes) {
              var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
              try {
                return beginWork(current2, unitOfWork, lanes);
              } catch (originalError) {
                if (originalError !== null && typeof originalError === "object" && typeof originalError.then === "function") {
                  throw originalError;
                }
                resetContextDependencies();
                resetHooksAfterThrow();
                unwindInterruptedWork(unitOfWork);
                assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
                if (unitOfWork.mode & ProfileMode) {
                  startProfilerTimer(unitOfWork);
                }
                invokeGuardedCallback(null, beginWork, null, current2, unitOfWork, lanes);
                if (hasCaughtError()) {
                  var replayError = clearCaughtError();
                  throw replayError;
                } else {
                  throw originalError;
                }
              }
            };
          }
          var didWarnAboutUpdateInRender = false;
          var didWarnAboutUpdateInRenderForAnotherComponent;
          {
            didWarnAboutUpdateInRenderForAnotherComponent = /* @__PURE__ */ new Set();
          }
          function warnAboutRenderPhaseUpdatesInDEV(fiber) {
            {
              if (isRendering && (executionContext & RenderContext) !== NoContext && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
                switch (fiber.tag) {
                  case FunctionComponent:
                  case ForwardRef:
                  case SimpleMemoComponent: {
                    var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || "Unknown";
                    var dedupeKey = renderingComponentName;
                    if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
                      didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
                      var setStateComponentName = getComponentName(fiber.type) || "Unknown";
                      error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render", setStateComponentName, renderingComponentName, renderingComponentName);
                    }
                    break;
                  }
                  case ClassComponent: {
                    if (!didWarnAboutUpdateInRender) {
                      error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.");
                      didWarnAboutUpdateInRender = true;
                    }
                    break;
                  }
                }
              }
            }
          }
          var IsThisRendererActing = {
            current: false
          };
          function warnIfNotScopedWithMatchingAct(fiber) {
            {
              if (IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {
                var previousFiber = current;
                try {
                  setCurrentFiber(fiber);
                  error("It looks like you're using the wrong act() around your test interactions.\nBe sure to use the matching version of act() corresponding to your renderer:\n\n// for react-dom:\nimport {act} from 'react-dom/test-utils';\n// ...\nact(() => ...);\n\n// for react-test-renderer:\nimport TestRenderer from react-test-renderer';\nconst {act} = TestRenderer;\n// ...\nact(() => ...);");
                } finally {
                  if (previousFiber) {
                    setCurrentFiber(fiber);
                  } else {
                    resetCurrentFiber();
                  }
                }
              }
            }
          }
          function warnIfNotCurrentlyActingEffectsInDEV(fiber) {
            {
              if ((fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
                error("An update to %s ran an effect, but was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n  /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act", getComponentName(fiber.type));
              }
            }
          }
          function warnIfNotCurrentlyActingUpdatesInDEV(fiber) {
            {
              if (executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
                var previousFiber = current;
                try {
                  setCurrentFiber(fiber);
                  error("An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n  /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act", getComponentName(fiber.type));
                } finally {
                  if (previousFiber) {
                    setCurrentFiber(fiber);
                  } else {
                    resetCurrentFiber();
                  }
                }
              }
            }
          }
          var warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV;
          var didWarnAboutUnmockedScheduler = false;
          function warnIfUnmockedScheduler(fiber) {
            {
              if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === void 0) {
                if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {
                  didWarnAboutUnmockedScheduler = true;
                  error(`In Concurrent or Sync modes, the "scheduler" module needs to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest: 
jest.mock('scheduler', () => require('scheduler/unstable_mock'));

For more info, visit https://reactjs.org/link/mock-scheduler`);
                }
              }
            }
          }
          function computeThreadID(root2, lane) {
            return lane * 1e3 + root2.interactionThreadID;
          }
          function markSpawnedWork(lane) {
            if (spawnedWorkDuringRender === null) {
              spawnedWorkDuringRender = [lane];
            } else {
              spawnedWorkDuringRender.push(lane);
            }
          }
          function scheduleInteractions(root2, lane, interactions) {
            if (interactions.size > 0) {
              var pendingInteractionMap = root2.pendingInteractionMap;
              var pendingInteractions = pendingInteractionMap.get(lane);
              if (pendingInteractions != null) {
                interactions.forEach(function(interaction) {
                  if (!pendingInteractions.has(interaction)) {
                    interaction.__count++;
                  }
                  pendingInteractions.add(interaction);
                });
              } else {
                pendingInteractionMap.set(lane, new Set(interactions));
                interactions.forEach(function(interaction) {
                  interaction.__count++;
                });
              }
              var subscriber = tracing.__subscriberRef.current;
              if (subscriber !== null) {
                var threadID = computeThreadID(root2, lane);
                subscriber.onWorkScheduled(interactions, threadID);
              }
            }
          }
          function schedulePendingInteractions(root2, lane) {
            scheduleInteractions(root2, lane, tracing.__interactionsRef.current);
          }
          function startWorkOnPendingInteractions(root2, lanes) {
            var interactions = /* @__PURE__ */ new Set();
            root2.pendingInteractionMap.forEach(function(scheduledInteractions, scheduledLane) {
              if (includesSomeLane(lanes, scheduledLane)) {
                scheduledInteractions.forEach(function(interaction) {
                  return interactions.add(interaction);
                });
              }
            });
            root2.memoizedInteractions = interactions;
            if (interactions.size > 0) {
              var subscriber = tracing.__subscriberRef.current;
              if (subscriber !== null) {
                var threadID = computeThreadID(root2, lanes);
                try {
                  subscriber.onWorkStarted(interactions, threadID);
                } catch (error2) {
                  scheduleCallback(ImmediatePriority$1, function() {
                    throw error2;
                  });
                }
              }
            }
          }
          function finishPendingInteractions(root2, committedLanes) {
            var remainingLanesAfterCommit = root2.pendingLanes;
            var subscriber;
            try {
              subscriber = tracing.__subscriberRef.current;
              if (subscriber !== null && root2.memoizedInteractions.size > 0) {
                var threadID = computeThreadID(root2, committedLanes);
                subscriber.onWorkStopped(root2.memoizedInteractions, threadID);
              }
            } catch (error2) {
              scheduleCallback(ImmediatePriority$1, function() {
                throw error2;
              });
            } finally {
              var pendingInteractionMap = root2.pendingInteractionMap;
              pendingInteractionMap.forEach(function(scheduledInteractions, lane) {
                if (!includesSomeLane(remainingLanesAfterCommit, lane)) {
                  pendingInteractionMap.delete(lane);
                  scheduledInteractions.forEach(function(interaction) {
                    interaction.__count--;
                    if (subscriber !== null && interaction.__count === 0) {
                      try {
                        subscriber.onInteractionScheduledWorkCompleted(interaction);
                      } catch (error2) {
                        scheduleCallback(ImmediatePriority$1, function() {
                          throw error2;
                        });
                      }
                    }
                  });
                }
              });
            }
          }
          function shouldForceFlushFallbacksInDEV() {
            return actingUpdatesScopeDepth > 0;
          }
          var actingUpdatesScopeDepth = 0;
          function detachFiberAfterEffects(fiber) {
            fiber.sibling = null;
            fiber.stateNode = null;
          }
          var resolveFamily = null;
          var failedBoundaries = null;
          var setRefreshHandler = function(handler) {
            {
              resolveFamily = handler;
            }
          };
          function resolveFunctionForHotReloading(type) {
            {
              if (resolveFamily === null) {
                return type;
              }
              var family = resolveFamily(type);
              if (family === void 0) {
                return type;
              }
              return family.current;
            }
          }
          function resolveClassForHotReloading(type) {
            return resolveFunctionForHotReloading(type);
          }
          function resolveForwardRefForHotReloading(type) {
            {
              if (resolveFamily === null) {
                return type;
              }
              var family = resolveFamily(type);
              if (family === void 0) {
                if (type !== null && type !== void 0 && typeof type.render === "function") {
                  var currentRender = resolveFunctionForHotReloading(type.render);
                  if (type.render !== currentRender) {
                    var syntheticType = {
                      $$typeof: REACT_FORWARD_REF_TYPE,
                      render: currentRender
                    };
                    if (type.displayName !== void 0) {
                      syntheticType.displayName = type.displayName;
                    }
                    return syntheticType;
                  }
                }
                return type;
              }
              return family.current;
            }
          }
          function isCompatibleFamilyForHotReloading(fiber, element) {
            {
              if (resolveFamily === null) {
                return false;
              }
              var prevType = fiber.elementType;
              var nextType = element.type;
              var needsCompareFamilies = false;
              var $$typeofNextType = typeof nextType === "object" && nextType !== null ? nextType.$$typeof : null;
              switch (fiber.tag) {
                case ClassComponent: {
                  if (typeof nextType === "function") {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                case FunctionComponent: {
                  if (typeof nextType === "function") {
                    needsCompareFamilies = true;
                  } else if ($$typeofNextType === REACT_LAZY_TYPE) {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                case ForwardRef: {
                  if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
                    needsCompareFamilies = true;
                  } else if ($$typeofNextType === REACT_LAZY_TYPE) {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                case MemoComponent:
                case SimpleMemoComponent: {
                  if ($$typeofNextType === REACT_MEMO_TYPE) {
                    needsCompareFamilies = true;
                  } else if ($$typeofNextType === REACT_LAZY_TYPE) {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                default:
                  return false;
              }
              if (needsCompareFamilies) {
                var prevFamily = resolveFamily(prevType);
                if (prevFamily !== void 0 && prevFamily === resolveFamily(nextType)) {
                  return true;
                }
              }
              return false;
            }
          }
          function markFailedErrorBoundaryForHotReloading(fiber) {
            {
              if (resolveFamily === null) {
                return;
              }
              if (typeof WeakSet !== "function") {
                return;
              }
              if (failedBoundaries === null) {
                failedBoundaries = /* @__PURE__ */ new WeakSet();
              }
              failedBoundaries.add(fiber);
            }
          }
          var scheduleRefresh = function(root2, update) {
            {
              if (resolveFamily === null) {
                return;
              }
              var staleFamilies = update.staleFamilies, updatedFamilies = update.updatedFamilies;
              flushPassiveEffects();
              flushSync(function() {
                scheduleFibersWithFamiliesRecursively(root2.current, updatedFamilies, staleFamilies);
              });
            }
          };
          var scheduleRoot = function(root2, element) {
            {
              if (root2.context !== emptyContextObject) {
                return;
              }
              flushPassiveEffects();
              flushSync(function() {
                updateContainer(element, root2, null, null);
              });
            }
          };
          function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
            {
              var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
              var candidateType = null;
              switch (tag) {
                case FunctionComponent:
                case SimpleMemoComponent:
                case ClassComponent:
                  candidateType = type;
                  break;
                case ForwardRef:
                  candidateType = type.render;
                  break;
              }
              if (resolveFamily === null) {
                throw new Error("Expected resolveFamily to be set during hot reload.");
              }
              var needsRender = false;
              var needsRemount = false;
              if (candidateType !== null) {
                var family = resolveFamily(candidateType);
                if (family !== void 0) {
                  if (staleFamilies.has(family)) {
                    needsRemount = true;
                  } else if (updatedFamilies.has(family)) {
                    if (tag === ClassComponent) {
                      needsRemount = true;
                    } else {
                      needsRender = true;
                    }
                  }
                }
              }
              if (failedBoundaries !== null) {
                if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
                  needsRemount = true;
                }
              }
              if (needsRemount) {
                fiber._debugNeedsRemount = true;
              }
              if (needsRemount || needsRender) {
                scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
              }
              if (child !== null && !needsRemount) {
                scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
              }
              if (sibling !== null) {
                scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
              }
            }
          }
          var findHostInstancesForRefresh = function(root2, families) {
            {
              var hostInstances = /* @__PURE__ */ new Set();
              var types = new Set(families.map(function(family) {
                return family.current;
              }));
              findHostInstancesForMatchingFibersRecursively(root2.current, types, hostInstances);
              return hostInstances;
            }
          };
          function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
            {
              var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
              var candidateType = null;
              switch (tag) {
                case FunctionComponent:
                case SimpleMemoComponent:
                case ClassComponent:
                  candidateType = type;
                  break;
                case ForwardRef:
                  candidateType = type.render;
                  break;
              }
              var didMatch = false;
              if (candidateType !== null) {
                if (types.has(candidateType)) {
                  didMatch = true;
                }
              }
              if (didMatch) {
                findHostInstancesForFiberShallowly(fiber, hostInstances);
              } else {
                if (child !== null) {
                  findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
                }
              }
              if (sibling !== null) {
                findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
              }
            }
          }
          function findHostInstancesForFiberShallowly(fiber, hostInstances) {
            {
              var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
              if (foundHostInstances) {
                return;
              }
              var node = fiber;
              while (true) {
                switch (node.tag) {
                  case HostComponent:
                    hostInstances.add(node.stateNode);
                    return;
                  case HostPortal:
                    hostInstances.add(node.stateNode.containerInfo);
                    return;
                  case HostRoot:
                    hostInstances.add(node.stateNode.containerInfo);
                    return;
                }
                if (node.return === null) {
                  throw new Error("Expected to reach root first.");
                }
                node = node.return;
              }
            }
          }
          function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
            {
              var node = fiber;
              var foundHostInstances = false;
              while (true) {
                if (node.tag === HostComponent) {
                  foundHostInstances = true;
                  hostInstances.add(node.stateNode);
                } else if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
                if (node === fiber) {
                  return foundHostInstances;
                }
                while (node.sibling === null) {
                  if (node.return === null || node.return === fiber) {
                    return foundHostInstances;
                  }
                  node = node.return;
                }
                node.sibling.return = node.return;
                node = node.sibling;
              }
            }
            return false;
          }
          var hasBadMapPolyfill;
          {
            hasBadMapPolyfill = false;
            try {
              var nonExtensibleObject = Object.preventExtensions({});
              /* @__PURE__ */ new Map([[nonExtensibleObject, null]]);
              /* @__PURE__ */ new Set([nonExtensibleObject]);
            } catch (e) {
              hasBadMapPolyfill = true;
            }
          }
          var debugCounter = 1;
          function FiberNode(tag, pendingProps, key2, mode) {
            this.tag = tag;
            this.key = key2;
            this.elementType = null;
            this.type = null;
            this.stateNode = null;
            this.return = null;
            this.child = null;
            this.sibling = null;
            this.index = 0;
            this.ref = null;
            this.pendingProps = pendingProps;
            this.memoizedProps = null;
            this.updateQueue = null;
            this.memoizedState = null;
            this.dependencies = null;
            this.mode = mode;
            this.flags = NoFlags;
            this.nextEffect = null;
            this.firstEffect = null;
            this.lastEffect = null;
            this.lanes = NoLanes;
            this.childLanes = NoLanes;
            this.alternate = null;
            {
              this.actualDuration = Number.NaN;
              this.actualStartTime = Number.NaN;
              this.selfBaseDuration = Number.NaN;
              this.treeBaseDuration = Number.NaN;
              this.actualDuration = 0;
              this.actualStartTime = -1;
              this.selfBaseDuration = 0;
              this.treeBaseDuration = 0;
            }
            {
              this._debugID = debugCounter++;
              this._debugSource = null;
              this._debugOwner = null;
              this._debugNeedsRemount = false;
              this._debugHookTypes = null;
              if (!hasBadMapPolyfill && typeof Object.preventExtensions === "function") {
                Object.preventExtensions(this);
              }
            }
          }
          var createFiber = function(tag, pendingProps, key2, mode) {
            return new FiberNode(tag, pendingProps, key2, mode);
          };
          function shouldConstruct$1(Component2) {
            var prototype = Component2.prototype;
            return !!(prototype && prototype.isReactComponent);
          }
          function isSimpleFunctionComponent(type) {
            return typeof type === "function" && !shouldConstruct$1(type) && type.defaultProps === void 0;
          }
          function resolveLazyComponentTag(Component2) {
            if (typeof Component2 === "function") {
              return shouldConstruct$1(Component2) ? ClassComponent : FunctionComponent;
            } else if (Component2 !== void 0 && Component2 !== null) {
              var $$typeof = Component2.$$typeof;
              if ($$typeof === REACT_FORWARD_REF_TYPE) {
                return ForwardRef;
              }
              if ($$typeof === REACT_MEMO_TYPE) {
                return MemoComponent;
              }
            }
            return IndeterminateComponent;
          }
          function createWorkInProgress(current2, pendingProps) {
            var workInProgress2 = current2.alternate;
            if (workInProgress2 === null) {
              workInProgress2 = createFiber(current2.tag, pendingProps, current2.key, current2.mode);
              workInProgress2.elementType = current2.elementType;
              workInProgress2.type = current2.type;
              workInProgress2.stateNode = current2.stateNode;
              {
                workInProgress2._debugID = current2._debugID;
                workInProgress2._debugSource = current2._debugSource;
                workInProgress2._debugOwner = current2._debugOwner;
                workInProgress2._debugHookTypes = current2._debugHookTypes;
              }
              workInProgress2.alternate = current2;
              current2.alternate = workInProgress2;
            } else {
              workInProgress2.pendingProps = pendingProps;
              workInProgress2.type = current2.type;
              workInProgress2.flags = NoFlags;
              workInProgress2.nextEffect = null;
              workInProgress2.firstEffect = null;
              workInProgress2.lastEffect = null;
              {
                workInProgress2.actualDuration = 0;
                workInProgress2.actualStartTime = -1;
              }
            }
            workInProgress2.childLanes = current2.childLanes;
            workInProgress2.lanes = current2.lanes;
            workInProgress2.child = current2.child;
            workInProgress2.memoizedProps = current2.memoizedProps;
            workInProgress2.memoizedState = current2.memoizedState;
            workInProgress2.updateQueue = current2.updateQueue;
            var currentDependencies = current2.dependencies;
            workInProgress2.dependencies = currentDependencies === null ? null : {
              lanes: currentDependencies.lanes,
              firstContext: currentDependencies.firstContext
            };
            workInProgress2.sibling = current2.sibling;
            workInProgress2.index = current2.index;
            workInProgress2.ref = current2.ref;
            {
              workInProgress2.selfBaseDuration = current2.selfBaseDuration;
              workInProgress2.treeBaseDuration = current2.treeBaseDuration;
            }
            {
              workInProgress2._debugNeedsRemount = current2._debugNeedsRemount;
              switch (workInProgress2.tag) {
                case IndeterminateComponent:
                case FunctionComponent:
                case SimpleMemoComponent:
                  workInProgress2.type = resolveFunctionForHotReloading(current2.type);
                  break;
                case ClassComponent:
                  workInProgress2.type = resolveClassForHotReloading(current2.type);
                  break;
                case ForwardRef:
                  workInProgress2.type = resolveForwardRefForHotReloading(current2.type);
                  break;
              }
            }
            return workInProgress2;
          }
          function resetWorkInProgress(workInProgress2, renderLanes2) {
            workInProgress2.flags &= Placement;
            workInProgress2.nextEffect = null;
            workInProgress2.firstEffect = null;
            workInProgress2.lastEffect = null;
            var current2 = workInProgress2.alternate;
            if (current2 === null) {
              workInProgress2.childLanes = NoLanes;
              workInProgress2.lanes = renderLanes2;
              workInProgress2.child = null;
              workInProgress2.memoizedProps = null;
              workInProgress2.memoizedState = null;
              workInProgress2.updateQueue = null;
              workInProgress2.dependencies = null;
              workInProgress2.stateNode = null;
              {
                workInProgress2.selfBaseDuration = 0;
                workInProgress2.treeBaseDuration = 0;
              }
            } else {
              workInProgress2.childLanes = current2.childLanes;
              workInProgress2.lanes = current2.lanes;
              workInProgress2.child = current2.child;
              workInProgress2.memoizedProps = current2.memoizedProps;
              workInProgress2.memoizedState = current2.memoizedState;
              workInProgress2.updateQueue = current2.updateQueue;
              workInProgress2.type = current2.type;
              var currentDependencies = current2.dependencies;
              workInProgress2.dependencies = currentDependencies === null ? null : {
                lanes: currentDependencies.lanes,
                firstContext: currentDependencies.firstContext
              };
              {
                workInProgress2.selfBaseDuration = current2.selfBaseDuration;
                workInProgress2.treeBaseDuration = current2.treeBaseDuration;
              }
            }
            return workInProgress2;
          }
          function createHostRootFiber(tag) {
            var mode;
            if (tag === ConcurrentRoot) {
              mode = ConcurrentMode | BlockingMode | StrictMode;
            } else if (tag === BlockingRoot) {
              mode = BlockingMode | StrictMode;
            } else {
              mode = NoMode;
            }
            if (isDevToolsPresent) {
              mode |= ProfileMode;
            }
            return createFiber(HostRoot, null, null, mode);
          }
          function createFiberFromTypeAndProps(type, key2, pendingProps, owner, mode, lanes) {
            var fiberTag = IndeterminateComponent;
            var resolvedType = type;
            if (typeof type === "function") {
              if (shouldConstruct$1(type)) {
                fiberTag = ClassComponent;
                {
                  resolvedType = resolveClassForHotReloading(resolvedType);
                }
              } else {
                {
                  resolvedType = resolveFunctionForHotReloading(resolvedType);
                }
              }
            } else if (typeof type === "string") {
              fiberTag = HostComponent;
            } else {
              getTag:
                switch (type) {
                  case REACT_FRAGMENT_TYPE:
                    return createFiberFromFragment(pendingProps.children, mode, lanes, key2);
                  case REACT_DEBUG_TRACING_MODE_TYPE:
                    fiberTag = Mode;
                    mode |= DebugTracingMode;
                    break;
                  case REACT_STRICT_MODE_TYPE:
                    fiberTag = Mode;
                    mode |= StrictMode;
                    break;
                  case REACT_PROFILER_TYPE:
                    return createFiberFromProfiler(pendingProps, mode, lanes, key2);
                  case REACT_SUSPENSE_TYPE:
                    return createFiberFromSuspense(pendingProps, mode, lanes, key2);
                  case REACT_SUSPENSE_LIST_TYPE:
                    return createFiberFromSuspenseList(pendingProps, mode, lanes, key2);
                  case REACT_OFFSCREEN_TYPE:
                    return createFiberFromOffscreen(pendingProps, mode, lanes, key2);
                  case REACT_LEGACY_HIDDEN_TYPE:
                    return createFiberFromLegacyHidden(pendingProps, mode, lanes, key2);
                  case REACT_SCOPE_TYPE:
                  default: {
                    if (typeof type === "object" && type !== null) {
                      switch (type.$$typeof) {
                        case REACT_PROVIDER_TYPE:
                          fiberTag = ContextProvider;
                          break getTag;
                        case REACT_CONTEXT_TYPE:
                          fiberTag = ContextConsumer;
                          break getTag;
                        case REACT_FORWARD_REF_TYPE:
                          fiberTag = ForwardRef;
                          {
                            resolvedType = resolveForwardRefForHotReloading(resolvedType);
                          }
                          break getTag;
                        case REACT_MEMO_TYPE:
                          fiberTag = MemoComponent;
                          break getTag;
                        case REACT_LAZY_TYPE:
                          fiberTag = LazyComponent;
                          resolvedType = null;
                          break getTag;
                        case REACT_BLOCK_TYPE:
                          fiberTag = Block;
                          break getTag;
                      }
                    }
                    var info = "";
                    {
                      if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
                        info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
                      }
                      var ownerName = owner ? getComponentName(owner.type) : null;
                      if (ownerName) {
                        info += "\n\nCheck the render method of `" + ownerName + "`.";
                      }
                    }
                    {
                      {
                        throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (type == null ? type : typeof type) + "." + info);
                      }
                    }
                  }
                }
            }
            var fiber = createFiber(fiberTag, pendingProps, key2, mode);
            fiber.elementType = type;
            fiber.type = resolvedType;
            fiber.lanes = lanes;
            {
              fiber._debugOwner = owner;
            }
            return fiber;
          }
          function createFiberFromElement(element, mode, lanes) {
            var owner = null;
            {
              owner = element._owner;
            }
            var type = element.type;
            var key2 = element.key;
            var pendingProps = element.props;
            var fiber = createFiberFromTypeAndProps(type, key2, pendingProps, owner, mode, lanes);
            {
              fiber._debugSource = element._source;
              fiber._debugOwner = element._owner;
            }
            return fiber;
          }
          function createFiberFromFragment(elements, mode, lanes, key2) {
            var fiber = createFiber(Fragment6, elements, key2, mode);
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromProfiler(pendingProps, mode, lanes, key2) {
            {
              if (typeof pendingProps.id !== "string") {
                error('Profiler must specify an "id" as a prop');
              }
            }
            var fiber = createFiber(Profiler, pendingProps, key2, mode | ProfileMode);
            fiber.elementType = REACT_PROFILER_TYPE;
            fiber.type = REACT_PROFILER_TYPE;
            fiber.lanes = lanes;
            {
              fiber.stateNode = {
                effectDuration: 0,
                passiveEffectDuration: 0
              };
            }
            return fiber;
          }
          function createFiberFromSuspense(pendingProps, mode, lanes, key2) {
            var fiber = createFiber(SuspenseComponent, pendingProps, key2, mode);
            fiber.type = REACT_SUSPENSE_TYPE;
            fiber.elementType = REACT_SUSPENSE_TYPE;
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromSuspenseList(pendingProps, mode, lanes, key2) {
            var fiber = createFiber(SuspenseListComponent, pendingProps, key2, mode);
            {
              fiber.type = REACT_SUSPENSE_LIST_TYPE;
            }
            fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromOffscreen(pendingProps, mode, lanes, key2) {
            var fiber = createFiber(OffscreenComponent, pendingProps, key2, mode);
            {
              fiber.type = REACT_OFFSCREEN_TYPE;
            }
            fiber.elementType = REACT_OFFSCREEN_TYPE;
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromLegacyHidden(pendingProps, mode, lanes, key2) {
            var fiber = createFiber(LegacyHiddenComponent, pendingProps, key2, mode);
            {
              fiber.type = REACT_LEGACY_HIDDEN_TYPE;
            }
            fiber.elementType = REACT_LEGACY_HIDDEN_TYPE;
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromText(content, mode, lanes) {
            var fiber = createFiber(HostText, content, null, mode);
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromHostInstanceForDeletion() {
            var fiber = createFiber(HostComponent, null, null, NoMode);
            fiber.elementType = "DELETED";
            fiber.type = "DELETED";
            return fiber;
          }
          function createFiberFromPortal(portal, mode, lanes) {
            var pendingProps = portal.children !== null ? portal.children : [];
            var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
            fiber.lanes = lanes;
            fiber.stateNode = {
              containerInfo: portal.containerInfo,
              pendingChildren: null,
              implementation: portal.implementation
            };
            return fiber;
          }
          function assignFiberPropertiesInDEV(target, source) {
            if (target === null) {
              target = createFiber(IndeterminateComponent, null, null, NoMode);
            }
            target.tag = source.tag;
            target.key = source.key;
            target.elementType = source.elementType;
            target.type = source.type;
            target.stateNode = source.stateNode;
            target.return = source.return;
            target.child = source.child;
            target.sibling = source.sibling;
            target.index = source.index;
            target.ref = source.ref;
            target.pendingProps = source.pendingProps;
            target.memoizedProps = source.memoizedProps;
            target.updateQueue = source.updateQueue;
            target.memoizedState = source.memoizedState;
            target.dependencies = source.dependencies;
            target.mode = source.mode;
            target.flags = source.flags;
            target.nextEffect = source.nextEffect;
            target.firstEffect = source.firstEffect;
            target.lastEffect = source.lastEffect;
            target.lanes = source.lanes;
            target.childLanes = source.childLanes;
            target.alternate = source.alternate;
            {
              target.actualDuration = source.actualDuration;
              target.actualStartTime = source.actualStartTime;
              target.selfBaseDuration = source.selfBaseDuration;
              target.treeBaseDuration = source.treeBaseDuration;
            }
            target._debugID = source._debugID;
            target._debugSource = source._debugSource;
            target._debugOwner = source._debugOwner;
            target._debugNeedsRemount = source._debugNeedsRemount;
            target._debugHookTypes = source._debugHookTypes;
            return target;
          }
          function FiberRootNode(containerInfo, tag, hydrate2) {
            this.tag = tag;
            this.containerInfo = containerInfo;
            this.pendingChildren = null;
            this.current = null;
            this.pingCache = null;
            this.finishedWork = null;
            this.timeoutHandle = noTimeout;
            this.context = null;
            this.pendingContext = null;
            this.hydrate = hydrate2;
            this.callbackNode = null;
            this.callbackPriority = NoLanePriority;
            this.eventTimes = createLaneMap(NoLanes);
            this.expirationTimes = createLaneMap(NoTimestamp);
            this.pendingLanes = NoLanes;
            this.suspendedLanes = NoLanes;
            this.pingedLanes = NoLanes;
            this.expiredLanes = NoLanes;
            this.mutableReadLanes = NoLanes;
            this.finishedLanes = NoLanes;
            this.entangledLanes = NoLanes;
            this.entanglements = createLaneMap(NoLanes);
            {
              this.mutableSourceEagerHydrationData = null;
            }
            {
              this.interactionThreadID = tracing.unstable_getThreadID();
              this.memoizedInteractions = /* @__PURE__ */ new Set();
              this.pendingInteractionMap = /* @__PURE__ */ new Map();
            }
            {
              switch (tag) {
                case BlockingRoot:
                  this._debugRootType = "createBlockingRoot()";
                  break;
                case ConcurrentRoot:
                  this._debugRootType = "createRoot()";
                  break;
                case LegacyRoot:
                  this._debugRootType = "createLegacyRoot()";
                  break;
              }
            }
          }
          function createFiberRoot(containerInfo, tag, hydrate2, hydrationCallbacks) {
            var root2 = new FiberRootNode(containerInfo, tag, hydrate2);
            var uninitializedFiber = createHostRootFiber(tag);
            root2.current = uninitializedFiber;
            uninitializedFiber.stateNode = root2;
            initializeUpdateQueue(uninitializedFiber);
            return root2;
          }
          function registerMutableSourceForHydration(root2, mutableSource) {
            var getVersion = mutableSource._getVersion;
            var version = getVersion(mutableSource._source);
            if (root2.mutableSourceEagerHydrationData == null) {
              root2.mutableSourceEagerHydrationData = [mutableSource, version];
            } else {
              root2.mutableSourceEagerHydrationData.push(mutableSource, version);
            }
          }
          function createPortal(children, containerInfo, implementation) {
            var key2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
            return {
              $$typeof: REACT_PORTAL_TYPE,
              key: key2 == null ? null : "" + key2,
              children,
              containerInfo,
              implementation
            };
          }
          var didWarnAboutNestedUpdates;
          var didWarnAboutFindNodeInStrictMode;
          {
            didWarnAboutNestedUpdates = false;
            didWarnAboutFindNodeInStrictMode = {};
          }
          function getContextForSubtree(parentComponent) {
            if (!parentComponent) {
              return emptyContextObject;
            }
            var fiber = get(parentComponent);
            var parentContext = findCurrentUnmaskedContext(fiber);
            if (fiber.tag === ClassComponent) {
              var Component2 = fiber.type;
              if (isContextProvider(Component2)) {
                return processChildContext(fiber, Component2, parentContext);
              }
            }
            return parentContext;
          }
          function findHostInstanceWithWarning(component, methodName) {
            {
              var fiber = get(component);
              if (fiber === void 0) {
                if (typeof component.render === "function") {
                  {
                    {
                      throw Error("Unable to find node on an unmounted component.");
                    }
                  }
                } else {
                  {
                    {
                      throw Error("Argument appears to not be a ReactComponent. Keys: " + Object.keys(component));
                    }
                  }
                }
              }
              var hostFiber = findCurrentHostFiber(fiber);
              if (hostFiber === null) {
                return null;
              }
              if (hostFiber.mode & StrictMode) {
                var componentName = getComponentName(fiber.type) || "Component";
                if (!didWarnAboutFindNodeInStrictMode[componentName]) {
                  didWarnAboutFindNodeInStrictMode[componentName] = true;
                  var previousFiber = current;
                  try {
                    setCurrentFiber(hostFiber);
                    if (fiber.mode & StrictMode) {
                      error("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
                    } else {
                      error("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
                    }
                  } finally {
                    if (previousFiber) {
                      setCurrentFiber(previousFiber);
                    } else {
                      resetCurrentFiber();
                    }
                  }
                }
              }
              return hostFiber.stateNode;
            }
          }
          function createContainer(containerInfo, tag, hydrate2, hydrationCallbacks) {
            return createFiberRoot(containerInfo, tag, hydrate2);
          }
          function updateContainer(element, container, parentComponent, callback) {
            {
              onScheduleRoot(container, element);
            }
            var current$1 = container.current;
            var eventTime = requestEventTime();
            {
              if ("undefined" !== typeof jest) {
                warnIfUnmockedScheduler(current$1);
                warnIfNotScopedWithMatchingAct(current$1);
              }
            }
            var lane = requestUpdateLane(current$1);
            var context = getContextForSubtree(parentComponent);
            if (container.context === null) {
              container.context = context;
            } else {
              container.pendingContext = context;
            }
            {
              if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
                didWarnAboutNestedUpdates = true;
                error("Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", getComponentName(current.type) || "Unknown");
              }
            }
            var update = createUpdate(eventTime, lane);
            update.payload = {
              element
            };
            callback = callback === void 0 ? null : callback;
            if (callback !== null) {
              {
                if (typeof callback !== "function") {
                  error("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callback);
                }
              }
              update.callback = callback;
            }
            enqueueUpdate(current$1, update);
            scheduleUpdateOnFiber(current$1, lane, eventTime);
            return lane;
          }
          function getPublicRootInstance(container) {
            var containerFiber = container.current;
            if (!containerFiber.child) {
              return null;
            }
            switch (containerFiber.child.tag) {
              case HostComponent:
                return getPublicInstance(containerFiber.child.stateNode);
              default:
                return containerFiber.child.stateNode;
            }
          }
          function markRetryLaneImpl(fiber, retryLane) {
            var suspenseState = fiber.memoizedState;
            if (suspenseState !== null && suspenseState.dehydrated !== null) {
              suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane);
            }
          }
          function markRetryLaneIfNotHydrated(fiber, retryLane) {
            markRetryLaneImpl(fiber, retryLane);
            var alternate = fiber.alternate;
            if (alternate) {
              markRetryLaneImpl(alternate, retryLane);
            }
          }
          function attemptUserBlockingHydration$1(fiber) {
            if (fiber.tag !== SuspenseComponent) {
              return;
            }
            var eventTime = requestEventTime();
            var lane = InputDiscreteHydrationLane;
            scheduleUpdateOnFiber(fiber, lane, eventTime);
            markRetryLaneIfNotHydrated(fiber, lane);
          }
          function attemptContinuousHydration$1(fiber) {
            if (fiber.tag !== SuspenseComponent) {
              return;
            }
            var eventTime = requestEventTime();
            var lane = SelectiveHydrationLane;
            scheduleUpdateOnFiber(fiber, lane, eventTime);
            markRetryLaneIfNotHydrated(fiber, lane);
          }
          function attemptHydrationAtCurrentPriority$1(fiber) {
            if (fiber.tag !== SuspenseComponent) {
              return;
            }
            var eventTime = requestEventTime();
            var lane = requestUpdateLane(fiber);
            scheduleUpdateOnFiber(fiber, lane, eventTime);
            markRetryLaneIfNotHydrated(fiber, lane);
          }
          function runWithPriority$2(priority, fn) {
            try {
              setCurrentUpdateLanePriority(priority);
              return fn();
            } finally {
            }
          }
          function findHostInstanceWithNoPortals(fiber) {
            var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
            if (hostFiber === null) {
              return null;
            }
            if (hostFiber.tag === FundamentalComponent) {
              return hostFiber.stateNode.instance;
            }
            return hostFiber.stateNode;
          }
          var shouldSuspendImpl = function(fiber) {
            return false;
          };
          function shouldSuspend(fiber) {
            return shouldSuspendImpl(fiber);
          }
          var overrideHookState = null;
          var overrideHookStateDeletePath = null;
          var overrideHookStateRenamePath = null;
          var overrideProps = null;
          var overridePropsDeletePath = null;
          var overridePropsRenamePath = null;
          var scheduleUpdate = null;
          var setSuspenseHandler = null;
          {
            var copyWithDeleteImpl = function(obj, path, index2) {
              var key2 = path[index2];
              var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
              if (index2 + 1 === path.length) {
                if (Array.isArray(updated)) {
                  updated.splice(key2, 1);
                } else {
                  delete updated[key2];
                }
                return updated;
              }
              updated[key2] = copyWithDeleteImpl(obj[key2], path, index2 + 1);
              return updated;
            };
            var copyWithDelete = function(obj, path) {
              return copyWithDeleteImpl(obj, path, 0);
            };
            var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
              var oldKey = oldPath[index2];
              var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
              if (index2 + 1 === oldPath.length) {
                var newKey = newPath[index2];
                updated[newKey] = updated[oldKey];
                if (Array.isArray(updated)) {
                  updated.splice(oldKey, 1);
                } else {
                  delete updated[oldKey];
                }
              } else {
                updated[oldKey] = copyWithRenameImpl(
                  obj[oldKey],
                  oldPath,
                  newPath,
                  index2 + 1
                );
              }
              return updated;
            };
            var copyWithRename = function(obj, oldPath, newPath) {
              if (oldPath.length !== newPath.length) {
                warn("copyWithRename() expects paths of the same length");
                return;
              } else {
                for (var i = 0; i < newPath.length - 1; i++) {
                  if (oldPath[i] !== newPath[i]) {
                    warn("copyWithRename() expects paths to be the same except for the deepest key");
                    return;
                  }
                }
              }
              return copyWithRenameImpl(obj, oldPath, newPath, 0);
            };
            var copyWithSetImpl = function(obj, path, index2, value) {
              if (index2 >= path.length) {
                return value;
              }
              var key2 = path[index2];
              var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
              updated[key2] = copyWithSetImpl(obj[key2], path, index2 + 1, value);
              return updated;
            };
            var copyWithSet = function(obj, path, value) {
              return copyWithSetImpl(obj, path, 0, value);
            };
            var findHook = function(fiber, id) {
              var currentHook2 = fiber.memoizedState;
              while (currentHook2 !== null && id > 0) {
                currentHook2 = currentHook2.next;
                id--;
              }
              return currentHook2;
            };
            overrideHookState = function(fiber, id, path, value) {
              var hook = findHook(fiber, id);
              if (hook !== null) {
                var newState = copyWithSet(hook.memoizedState, path, value);
                hook.memoizedState = newState;
                hook.baseState = newState;
                fiber.memoizedProps = _assign({}, fiber.memoizedProps);
                scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
              }
            };
            overrideHookStateDeletePath = function(fiber, id, path) {
              var hook = findHook(fiber, id);
              if (hook !== null) {
                var newState = copyWithDelete(hook.memoizedState, path);
                hook.memoizedState = newState;
                hook.baseState = newState;
                fiber.memoizedProps = _assign({}, fiber.memoizedProps);
                scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
              }
            };
            overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
              var hook = findHook(fiber, id);
              if (hook !== null) {
                var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
                hook.memoizedState = newState;
                hook.baseState = newState;
                fiber.memoizedProps = _assign({}, fiber.memoizedProps);
                scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
              }
            };
            overrideProps = function(fiber, path, value) {
              fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
              if (fiber.alternate) {
                fiber.alternate.pendingProps = fiber.pendingProps;
              }
              scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
            };
            overridePropsDeletePath = function(fiber, path) {
              fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path);
              if (fiber.alternate) {
                fiber.alternate.pendingProps = fiber.pendingProps;
              }
              scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
            };
            overridePropsRenamePath = function(fiber, oldPath, newPath) {
              fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);
              if (fiber.alternate) {
                fiber.alternate.pendingProps = fiber.pendingProps;
              }
              scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
            };
            scheduleUpdate = function(fiber) {
              scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
            };
            setSuspenseHandler = function(newShouldSuspendImpl) {
              shouldSuspendImpl = newShouldSuspendImpl;
            };
          }
          function findHostInstanceByFiber(fiber) {
            var hostFiber = findCurrentHostFiber(fiber);
            if (hostFiber === null) {
              return null;
            }
            return hostFiber.stateNode;
          }
          function emptyFindFiberByHostInstance(instance) {
            return null;
          }
          function getCurrentFiberForDevTools() {
            return current;
          }
          function injectIntoDevTools(devToolsConfig) {
            var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
            var ReactCurrentDispatcher2 = ReactSharedInternals.ReactCurrentDispatcher;
            return injectInternals({
              bundleType: devToolsConfig.bundleType,
              version: devToolsConfig.version,
              rendererPackageName: devToolsConfig.rendererPackageName,
              rendererConfig: devToolsConfig.rendererConfig,
              overrideHookState,
              overrideHookStateDeletePath,
              overrideHookStateRenamePath,
              overrideProps,
              overridePropsDeletePath,
              overridePropsRenamePath,
              setSuspenseHandler,
              scheduleUpdate,
              currentDispatcherRef: ReactCurrentDispatcher2,
              findHostInstanceByFiber,
              findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,
              findHostInstancesForRefresh,
              scheduleRefresh,
              scheduleRoot,
              setRefreshHandler,
              getCurrentFiber: getCurrentFiberForDevTools
            });
          }
          function ReactDOMRoot(container, options2) {
            this._internalRoot = createRootImpl(container, ConcurrentRoot, options2);
          }
          function ReactDOMBlockingRoot(container, tag, options2) {
            this._internalRoot = createRootImpl(container, tag, options2);
          }
          ReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function(children) {
            var root2 = this._internalRoot;
            {
              if (typeof arguments[1] === "function") {
                error("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
              }
              var container = root2.containerInfo;
              if (container.nodeType !== COMMENT_NODE) {
                var hostInstance = findHostInstanceWithNoPortals(root2.current);
                if (hostInstance) {
                  if (hostInstance.parentNode !== container) {
                    error("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.");
                  }
                }
              }
            }
            updateContainer(children, root2, null, null);
          };
          ReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function() {
            {
              if (typeof arguments[0] === "function") {
                error("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
              }
            }
            var root2 = this._internalRoot;
            var container = root2.containerInfo;
            updateContainer(null, root2, null, function() {
              unmarkContainerAsRoot(container);
            });
          };
          function createRootImpl(container, tag, options2) {
            var hydrate2 = options2 != null && options2.hydrate === true;
            var hydrationCallbacks = options2 != null && options2.hydrationOptions || null;
            var mutableSources = options2 != null && options2.hydrationOptions != null && options2.hydrationOptions.mutableSources || null;
            var root2 = createContainer(container, tag, hydrate2);
            markContainerAsRoot(root2.current, container);
            var containerNodeType = container.nodeType;
            {
              var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
              listenToAllSupportedEvents(rootContainerElement);
            }
            if (mutableSources) {
              for (var i = 0; i < mutableSources.length; i++) {
                var mutableSource = mutableSources[i];
                registerMutableSourceForHydration(root2, mutableSource);
              }
            }
            return root2;
          }
          function createLegacyRoot(container, options2) {
            return new ReactDOMBlockingRoot(container, LegacyRoot, options2);
          }
          function isValidContainer(node) {
            return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === " react-mount-point-unstable "));
          }
          var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
          var topLevelUpdateWarnings;
          var warnedAboutHydrateAPI = false;
          {
            topLevelUpdateWarnings = function(container) {
              if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
                var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);
                if (hostInstance) {
                  if (hostInstance.parentNode !== container) {
                    error("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.");
                  }
                }
              }
              var isRootRenderedBySomeReact = !!container._reactRootContainer;
              var rootEl = getReactRootElementInContainer(container);
              var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl));
              if (hasNonRootReactChild && !isRootRenderedBySomeReact) {
                error("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render.");
              }
              if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
                error("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.");
              }
            };
          }
          function getReactRootElementInContainer(container) {
            if (!container) {
              return null;
            }
            if (container.nodeType === DOCUMENT_NODE) {
              return container.documentElement;
            } else {
              return container.firstChild;
            }
          }
          function shouldHydrateDueToLegacyHeuristic(container) {
            var rootElement = getReactRootElementInContainer(container);
            return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
          }
          function legacyCreateRootFromDOMContainer(container, forceHydrate) {
            var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container);
            if (!shouldHydrate) {
              var warned = false;
              var rootSibling;
              while (rootSibling = container.lastChild) {
                {
                  if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
                    warned = true;
                    error("render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup.");
                  }
                }
                container.removeChild(rootSibling);
              }
            }
            {
              if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
                warnedAboutHydrateAPI = true;
                warn("render(): Calling ReactDOM.render() to hydrate server-rendered markup will stop working in React v18. Replace the ReactDOM.render() call with ReactDOM.hydrate() if you want React to attach to the server HTML.");
              }
            }
            return createLegacyRoot(container, shouldHydrate ? {
              hydrate: true
            } : void 0);
          }
          function warnOnInvalidCallback$1(callback, callerName) {
            {
              if (callback !== null && typeof callback !== "function") {
                error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
              }
            }
          }
          function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
            {
              topLevelUpdateWarnings(container);
              warnOnInvalidCallback$1(callback === void 0 ? null : callback, "render");
            }
            var root2 = container._reactRootContainer;
            var fiberRoot;
            if (!root2) {
              root2 = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);
              fiberRoot = root2._internalRoot;
              if (typeof callback === "function") {
                var originalCallback = callback;
                callback = function() {
                  var instance = getPublicRootInstance(fiberRoot);
                  originalCallback.call(instance);
                };
              }
              unbatchedUpdates(function() {
                updateContainer(children, fiberRoot, parentComponent, callback);
              });
            } else {
              fiberRoot = root2._internalRoot;
              if (typeof callback === "function") {
                var _originalCallback = callback;
                callback = function() {
                  var instance = getPublicRootInstance(fiberRoot);
                  _originalCallback.call(instance);
                };
              }
              updateContainer(children, fiberRoot, parentComponent, callback);
            }
            return getPublicRootInstance(fiberRoot);
          }
          function findDOMNode(componentOrElement) {
            {
              var owner = ReactCurrentOwner$3.current;
              if (owner !== null && owner.stateNode !== null) {
                var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
                if (!warnedAboutRefsInRender) {
                  error("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentName(owner.type) || "A component");
                }
                owner.stateNode._warnedAboutRefsInRender = true;
              }
            }
            if (componentOrElement == null) {
              return null;
            }
            if (componentOrElement.nodeType === ELEMENT_NODE) {
              return componentOrElement;
            }
            {
              return findHostInstanceWithWarning(componentOrElement, "findDOMNode");
            }
          }
          function hydrate(element, container, callback) {
            if (!isValidContainer(container)) {
              {
                throw Error("Target container is not a DOM element.");
              }
            }
            {
              var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
              if (isModernRoot) {
                error("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call createRoot(container, {hydrate: true}).render(element)?");
              }
            }
            return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
          }
          function render(element, container, callback) {
            if (!isValidContainer(container)) {
              {
                throw Error("Target container is not a DOM element.");
              }
            }
            {
              var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
              if (isModernRoot) {
                error("You are calling ReactDOM.render() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.render(element)?");
              }
            }
            return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
          }
          function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
            if (!isValidContainer(containerNode)) {
              {
                throw Error("Target container is not a DOM element.");
              }
            }
            if (!(parentComponent != null && has(parentComponent))) {
              {
                throw Error("parentComponent must be a valid React Component");
              }
            }
            return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
          }
          function unmountComponentAtNode(container) {
            if (!isValidContainer(container)) {
              {
                throw Error("unmountComponentAtNode(...): Target container is not a DOM element.");
              }
            }
            {
              var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
              if (isModernRoot) {
                error("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?");
              }
            }
            if (container._reactRootContainer) {
              {
                var rootEl = getReactRootElementInContainer(container);
                var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl);
                if (renderedByDifferentReact) {
                  error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
                }
              }
              unbatchedUpdates(function() {
                legacyRenderSubtreeIntoContainer(null, null, container, false, function() {
                  container._reactRootContainer = null;
                  unmarkContainerAsRoot(container);
                });
              });
              return true;
            } else {
              {
                var _rootEl = getReactRootElementInContainer(container);
                var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl));
                var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;
                if (hasNonRootReactChild) {
                  error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", isContainerReactRoot ? "You may have accidentally passed in a React root node instead of its container." : "Instead, have the parent component update its state and rerender in order to remove this component.");
                }
              }
              return false;
            }
          }
          setAttemptUserBlockingHydration(attemptUserBlockingHydration$1);
          setAttemptContinuousHydration(attemptContinuousHydration$1);
          setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
          setAttemptHydrationAtPriority(runWithPriority$2);
          var didWarnAboutUnstableCreatePortal = false;
          {
            if (typeof Map !== "function" || Map.prototype == null || typeof Map.prototype.forEach !== "function" || typeof Set !== "function" || Set.prototype == null || typeof Set.prototype.clear !== "function" || typeof Set.prototype.forEach !== "function") {
              error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
            }
          }
          setRestoreImplementation(restoreControlledState$3);
          setBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);
          function createPortal$1(children, container) {
            var key2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
            if (!isValidContainer(container)) {
              {
                throw Error("Target container is not a DOM element.");
              }
            }
            return createPortal(children, container, null, key2);
          }
          function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
            return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
          }
          function unstable_createPortal(children, container) {
            var key2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
            {
              if (!didWarnAboutUnstableCreatePortal) {
                didWarnAboutUnstableCreatePortal = true;
                warn('The ReactDOM.unstable_createPortal() alias has been deprecated, and will be removed in React 18+. Update your code to use ReactDOM.createPortal() instead. It has the exact same API, but without the "unstable_" prefix.');
              }
            }
            return createPortal$1(children, container, key2);
          }
          var Internals = {
            Events: [
              getInstanceFromNode,
              getNodeFromInstance,
              getFiberCurrentPropsFromNode,
              enqueueStateRestore,
              restoreStateIfNeeded,
              flushPassiveEffects,
              IsThisRendererActing
            ]
          };
          var foundDevTools = injectIntoDevTools({
            findFiberByHostInstance: getClosestInstanceFromNode,
            bundleType: 1,
            version: ReactVersion,
            rendererPackageName: "react-dom"
          });
          {
            if (!foundDevTools && canUseDOM && window.top === window.self) {
              if (navigator.userAgent.indexOf("Chrome") > -1 && navigator.userAgent.indexOf("Edge") === -1 || navigator.userAgent.indexOf("Firefox") > -1) {
                var protocol = window.location.protocol;
                if (/^(https?|file):$/.test(protocol)) {
                  console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools" + (protocol === "file:" ? "\nYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq" : ""), "font-weight:bold");
                }
              }
            }
          }
          exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
          exports.createPortal = createPortal$1;
          exports.findDOMNode = findDOMNode;
          exports.flushSync = flushSync;
          exports.hydrate = hydrate;
          exports.render = render;
          exports.unmountComponentAtNode = unmountComponentAtNode;
          exports.unstable_batchedUpdates = batchedUpdates$1;
          exports.unstable_createPortal = unstable_createPortal;
          exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
          exports.version = ReactVersion;
        })();
      }
    }
  });

  // node_modules/react-dom/index.js
  var require_react_dom = __commonJS({
    "node_modules/react-dom/index.js"(exports, module) {
      "use strict";
      if (false) {
        checkDCE();
        module.exports = null;
      } else {
        module.exports = require_react_dom_development();
      }
    }
  });

  // src/jupyterRender.tsx
  var React214 = __toESM(require_react());
  var import_react_dom2 = __toESM(require_react_dom());

  // src/components/Mito.tsx
  var import_react222 = __toESM(require_react());

  // src/components/taskpanes/Graph/graphUtils.tsx
  var import_react23 = __toESM(require_react());

  // src/utils/arrays.tsx
  function intersection(array1, array2) {
    const finalArray = [];
    array1.forEach((element) => {
      if (array2.indexOf(element) >= 0) {
        finalArray.push(element);
      }
    });
    return finalArray;
  }
  function toggleInArray(array, value) {
    const index = array.indexOf(value);
    if (index === -1) {
      array.push(value);
    } else {
      array.splice(index, 1);
    }
    return array;
  }

  // src/utils/columnHeaders.tsx
  var isPrimitiveColumnHeader = (columnHeader) => {
    return typeof columnHeader === "string" || typeof columnHeader === "number" || typeof columnHeader === "boolean";
  };
  var getDisplayColumnHeader = (columnHeader) => {
    if (isPrimitiveColumnHeader(columnHeader)) {
      return columnHeader.toString();
    } else {
      return columnHeader.map((c) => c.toString()).filter((c) => c !== "").join(", ");
    }
  };
  var columnIDMapToDisplayHeadersMap = (columnIDsMap) => {
    return Object.fromEntries(Object.entries(columnIDsMap).map(([columnID, columnHeader]) => {
      return [columnID, getDisplayColumnHeader(columnHeader)];
    }));
  };
  var isSingleStringMultiIndexHeader = (columnHeader) => {
    if (isPrimitiveColumnHeader(columnHeader)) {
      return true;
    }
    for (let i = 1; i < columnHeader.length; i++) {
      if (columnHeader[i] !== "") {
        return false;
      }
    }
    return true;
  };
  var getColumnHeaderParts = (columnHeader) => {
    if (isPrimitiveColumnHeader(columnHeader)) {
      return {
        lowerLevelColumnHeaders: [],
        finalColumnHeader: columnHeader
      };
    } else {
      if (isSingleStringMultiIndexHeader(columnHeader)) {
        return {
          lowerLevelColumnHeaders: columnHeader.slice(1),
          finalColumnHeader: columnHeader[0]
        };
      }
      const lowerLevelColumnHeaders = columnHeader.slice(0, columnHeader.length - 1);
      const finalColumnHeader = columnHeader[columnHeader.length - 1];
      return {
        lowerLevelColumnHeaders,
        finalColumnHeader
      };
    }
  };
  var rowIndexToColumnHeaderLevel = (columnHeader, rowIndex) => {
    if (isSingleStringMultiIndexHeader(columnHeader)) {
      return 0;
    }
    return columnHeader.length - rowIndex * -1;
  };
  var getFirstCharactersOfColumnHeaders = (columnHeaders, num) => {
    const columnHeadersCopy = [...columnHeaders];
    let charsRemaining = num;
    const columnHeadersToDisplay = [];
    while (columnHeadersCopy.length > 0 && charsRemaining > 0) {
      const nextFullString = getDisplayColumnHeader(columnHeadersCopy.shift() || "");
      let nextPartialString = "";
      for (let i = 0; i < nextFullString.length; i++) {
        if (charsRemaining > 0) {
          nextPartialString += nextFullString[i];
          charsRemaining--;
        }
      }
      columnHeadersToDisplay.push(nextPartialString);
    }
    return [columnHeadersToDisplay.join(", "), columnHeadersCopy.length];
  };
  var getNewColumnHeader = () => {
    let result = "";
    const characters = "abcdefghijklmnopqrstuvwxyz0123456789";
    const charactersLength = characters.length;
    for (let i = 0; i < 4; i++) {
      result += characters.charAt(Math.floor(Math.random() * charactersLength));
    }
    return result;
  };
  var getColumnIDByIndex = (sheetData, columnIndex) => {
    return Object.keys(sheetData.columnIDsMap)[columnIndex];
  };

  // src/utils/dtypes.tsx
  function isBoolDtype(dtype) {
    return dtype == "bool";
  }
  function isIntDtype(dtype) {
    return dtype.includes("int");
  }
  function isFloatDtype(dtype) {
    return dtype.includes("float");
  }
  function isStringDtype(dtype) {
    return dtype == "object" || dtype == "str" || dtype == "string";
  }
  function isDatetimeDtype(dtype) {
    return dtype.includes("datetime");
  }
  function isTimedeltaDtype(dtype) {
    return dtype.includes("timedelta");
  }
  function isNumberDtype(dtype) {
    return isIntDtype(dtype) || isFloatDtype(dtype);
  }

  // src/utils/numbers.tsx
  var isOnlyNumberString = (possibleNumber) => {
    return /^\d+\.?\d*$/.test(possibleNumber);
  };
  var isNum = (possibleNumber) => {
    return !isNaN(Number(possibleNumber));
  };
  var convertStringToFloatOrUndefined = (possibleNumber) => {
    return possibleNumber !== void 0 && isNum(possibleNumber) ? parseFloat(possibleNumber) : void 0;
  };

  // src/utils/strings.tsx
  var fuzzyMatch = (stringOne, stringTwo) => {
    stringOne = stringOne.toLowerCase();
    stringTwo = stringTwo.toLowerCase();
    if (stringOne.includes(stringTwo)) {
      return 1;
    }
    const possibleTypos = [
      stringTwo,
      stringTwo.replace(" ", "-"),
      stringTwo.replace(" ", "_"),
      stringTwo.replace(" ", "."),
      stringTwo.replace(" ", ""),
      stringTwo.replace("_", " "),
      stringTwo.replace("-", " "),
      stringTwo.replace(".", " ")
    ];
    const stringOneIgnoredCharacters = [
      stringOne,
      stringOne.replace(",", "")
    ];
    for (let i = 0; i < possibleTypos.length; i++) {
      for (let j = 0; j < stringOneIgnoredCharacters.length; j++) {
        if (stringOneIgnoredCharacters[j].includes(possibleTypos[i])) {
          return 1;
        }
      }
    }
    return 0;
  };
  var convertToStringOrUndefined = (possibleString) => {
    return possibleString !== void 0 ? possibleString.toString() : void 0;
  };
  function capitalizeFirstLetter(s) {
    return s.charAt(0).toUpperCase() + s.slice(1);
  }

  // src/components/elements/DropdownItem.tsx
  var import_react5 = __toESM(require_react());

  // src/utils/classNames.tsx
  var classNames = (...args) => {
    let finalString = "";
    for (let i = 0; i < args.length; i++) {
      const arg = args[i];
      if (arg === void 0) {
        continue;
      }
      if (typeof arg === "string") {
        finalString += arg + " ";
      } else {
        Object.entries(arg).map(([className, include]) => {
          if (include) {
            finalString += className + " ";
          }
        });
      }
    }
    return finalString;
  };

  // src/components/layout/Row.tsx
  var import_react = __toESM(require_react());
  var Row = (props) => {
    const marginClass = props.suppressTopBottomMargin ? "spacing-row-no-top-bottom-margin" : "spacing-row-top-bottom-margin";
    return /* @__PURE__ */ import_react.default.createElement(
      "div",
      {
        className: classNames("spacing-row", marginClass, props.className),
        title: props.title,
        onClick: props.onClick,
        style: __spreadProps(__spreadValues({}, props.style), {
          justifyContent: props.justify,
          alignItems: props.align
        })
      },
      props.children
    );
  };
  var Row_default = Row;

  // node_modules/fscreen/dist/fscreen.esm.js
  var key = {
    fullscreenEnabled: 0,
    fullscreenElement: 1,
    requestFullscreen: 2,
    exitFullscreen: 3,
    fullscreenchange: 4,
    fullscreenerror: 5,
    fullscreen: 6
  };
  var webkit = [
    "webkitFullscreenEnabled",
    "webkitFullscreenElement",
    "webkitRequestFullscreen",
    "webkitExitFullscreen",
    "webkitfullscreenchange",
    "webkitfullscreenerror",
    "-webkit-full-screen"
  ];
  var moz = [
    "mozFullScreenEnabled",
    "mozFullScreenElement",
    "mozRequestFullScreen",
    "mozCancelFullScreen",
    "mozfullscreenchange",
    "mozfullscreenerror",
    "-moz-full-screen"
  ];
  var ms = [
    "msFullscreenEnabled",
    "msFullscreenElement",
    "msRequestFullscreen",
    "msExitFullscreen",
    "MSFullscreenChange",
    "MSFullscreenError",
    "-ms-fullscreen"
  ];
  var document2 = typeof window !== "undefined" && typeof window.document !== "undefined" ? window.document : {};
  var vendor = "fullscreenEnabled" in document2 && Object.keys(key) || webkit[0] in document2 && webkit || moz[0] in document2 && moz || ms[0] in document2 && ms || [];
  var fscreen = {
    requestFullscreen: function(element) {
      return element[vendor[key.requestFullscreen]]();
    },
    requestFullscreenFunction: function(element) {
      return element[vendor[key.requestFullscreen]];
    },
    get exitFullscreen() {
      return document2[vendor[key.exitFullscreen]].bind(document2);
    },
    get fullscreenPseudoClass() {
      return ":" + vendor[key.fullscreen];
    },
    addEventListener: function(type, handler, options) {
      return document2.addEventListener(vendor[key[type]], handler, options);
    },
    removeEventListener: function(type, handler, options) {
      return document2.removeEventListener(vendor[key[type]], handler, options);
    },
    get fullscreenEnabled() {
      return Boolean(document2[vendor[key.fullscreenEnabled]]);
    },
    set fullscreenEnabled(val) {
    },
    get fullscreenElement() {
      return document2[vendor[key.fullscreenElement]];
    },
    set fullscreenElement(val) {
    },
    get onfullscreenchange() {
      return document2[("on" + vendor[key.fullscreenchange]).toLowerCase()];
    },
    set onfullscreenchange(handler) {
      return document2[("on" + vendor[key.fullscreenchange]).toLowerCase()] = handler;
    },
    get onfullscreenerror() {
      return document2[("on" + vendor[key.fullscreenerror]).toLowerCase()];
    },
    set onfullscreenerror(handler) {
      return document2[("on" + vendor[key.fullscreenerror]).toLowerCase()] = handler;
    }
  };
  var fscreen_esm_default = fscreen;

  // src/components/elements/Dropdown.tsx
  var import_react4 = __toESM(require_react());
  var import_react_dom = __toESM(require_react_dom());

  // src/hooks/useCallOnAnyClick.tsx
  var import_react2 = __toESM(require_react());
  var clickedOnClass = (targetNode, className) => {
    if (targetNode !== null && targetNode instanceof Node && targetNode.nodeType === Node.ELEMENT_NODE && className !== void 0) {
      let currentElement = targetNode;
      while (currentElement) {
        if (currentElement.classList.contains(className)) {
          return true;
        }
        currentElement = currentElement.parentElement;
      }
    }
    return false;
  };
  function useCallOnAnyClick(onClick, noActionClassName) {
    const handleClick = (event) => {
      const targetNode = event.target;
      if (clickedOnClass(targetNode, noActionClassName)) {
        return;
      }
      setTimeout(() => {
        onClick(targetNode);
      }, 100);
    };
    (0, import_react2.useEffect)(() => {
      document.addEventListener("click", handleClick, true);
      return () => {
        document.removeEventListener("click", handleClick, true);
      };
    });
  }

  // src/components/elements/Input.tsx
  var import_react3 = __toESM(require_react());
  var Input = (props) => {
    const ref = (0, import_react3.useRef)(null);
    const [width, setWidth] = (0, import_react3.useState)(props.width);
    const widthWithDefault = width || "block";
    const autoFocus = props.autoFocus || false;
    const widthClass = `element-width-${widthWithDefault}`;
    const paddingRight = props.rightText !== void 0 ? props.rightText.length * 6 + 10 : void 0;
    (0, import_react3.useEffect)(() => {
      var _a;
      if (autoFocus) {
        (_a = ref.current) == null ? void 0 : _a.focus();
      }
    }, []);
    return /* @__PURE__ */ import_react3.default.createElement("div", { className: "mito-input-container" }, /* @__PURE__ */ import_react3.default.createElement(
      "input",
      {
        id: props.id,
        className: classNames("mito-input", "text-body-2", widthClass, props.className),
        style: { paddingRight },
        value: props.value,
        placeholder: props.placeholder,
        onKeyDown: (e) => {
          if (props.onKeyDown) {
            props.onKeyDown(e);
          }
          if (props.onEscape && e.key == "Escape") {
            props.onEscape();
          }
        },
        onKeyPress: props.onKeyPress,
        onChange: props.onChange,
        onClick: props.onClick,
        onDoubleClick: props.onDoubleClick,
        autoFocus: props.autoFocus,
        required: props.required,
        disabled: props.disabled,
        type: props.type,
        ref,
        onFocus: (e) => {
          if (props.onFocus !== void 0) {
            props.onFocus(e);
          }
          if (props.widthOnFocus !== void 0) {
            setWidth(props.widthOnFocus);
          }
          if (props.selectTextOnFocus) {
            setTimeout(() => {
              e.target.select();
            }, 50);
          }
        },
        onBlur: (e) => {
          if (props.onBlur !== void 0) {
            props.onBlur(e);
          }
          setWidth(props.width);
        }
      }
    ), props.rightText && /* @__PURE__ */ import_react3.default.createElement("div", { className: "mito-input-right-text" }, props.rightText));
  };
  var Input_default = Input;

  // src/components/elements/sizes.d.tsx
  var WIDTH_MAPPING = {
    "small": 100,
    "medium": 170,
    "medium-large": 250,
    "large": 345
  };

  // src/components/elements/Dropdown.tsx
  var MAX_HEIGHT = 250;
  var topInBounds = (top) => {
    const windowHeight = window.innerHeight;
    return top + MAX_HEIGHT < windowHeight;
  };
  var leftInBounds = (left, widthPixels) => {
    const widthWidth = window.innerWidth;
    return left + widthPixels < widthWidth;
  };
  var bottomInBounds = (bottom) => {
    return bottom - MAX_HEIGHT > 0;
  };
  var rightInBounds = (right, widthPixels) => {
    return right - widthPixels > 0;
  };
  var DROPDOWN_IGNORE_CLICK_CLASS = "mito-dropdown-ignore-click";
  var DROPDOWN_SUPRESS_FOCUS_ON_CLOSE = "mito-dropdown-suppress-focus-on-close";
  var ensureInView = (container, element, topAdjustment) => {
    const containerTop = container.scrollTop;
    const containerBottom = containerTop + container.clientHeight;
    const elementTop = element.offsetTop;
    const elementBottom = elementTop + element.clientHeight;
    if (elementTop < containerTop + topAdjustment) {
      container.scrollTop -= containerTop - elementTop + topAdjustment;
    } else if (elementBottom > containerBottom) {
      container.scrollTop += elementBottom - containerBottom;
    }
  };
  var handleKeyboardInDropdown = (e, numDropdownItems, setSelectedIndex, onEscape) => {
    const keyUp = e.key === "Up" || e.key === "ArrowUp";
    const keyDown = e.key === "Down" || e.key === "ArrowDown";
    const enterDown = e.key === "Enter";
    const escapeDown = e.key === "Escape";
    const metaKey = e.metaKey;
    if (keyUp || keyDown) {
      e.preventDefault();
      if (keyUp) {
        setSelectedIndex((selectedIndex) => {
          if (metaKey) {
            if (selectedIndex > 0) {
              return 0;
            }
            return -1;
          } else {
            return Math.max(-1, selectedIndex - 1);
          }
        });
      } else {
        setSelectedIndex((selectedIndex) => {
          if (metaKey) {
            return numDropdownItems - 1;
          } else {
            return Math.min(selectedIndex + 1, numDropdownItems - 1);
          }
        });
      }
      setTimeout(() => {
        const dropdownDiv = document.querySelector(".mito-dropdown-items-container");
        const selectedItemDiv = document.querySelector(".mito-dropdown-item-selected");
        if (dropdownDiv !== null && selectedItemDiv !== null) {
          ensureInView(dropdownDiv, selectedItemDiv, 50);
        }
      });
    } else if (enterDown) {
      setTimeout(() => {
        const selectedItemDiv = document.querySelector(".mito-dropdown-item-selected");
        if (selectedItemDiv) {
          selectedItemDiv.click();
        }
      }, 200);
    } else if (escapeDown) {
      onEscape();
    }
  };
  var Dropdown = (props) => {
    const [searchString, setSearchString] = (0, import_react4.useState)("");
    const [selectedIndex, setSelectedIndex] = (0, import_react4.useState)(-1);
    useCallOnAnyClick((eventTarget) => {
      var _a;
      if (!props.display) {
        return;
      }
      props.closeDropdown();
      if (!clickedOnClass(eventTarget, DROPDOWN_SUPRESS_FOCUS_ON_CLOSE)) {
        (_a = dropdownAnchor.current) == null ? void 0 : _a.focus();
      }
    }, DROPDOWN_IGNORE_CLICK_CLASS);
    const [boundingRect, setBoundingRect] = (0, import_react4.useState)({
      top: void 0,
      bottom: void 0,
      right: void 0,
      left: void 0
    });
    const dropdownAnchor = (0, import_react4.useRef)(null);
    const dropdownContainerElement = (0, import_react4.useRef)(document.createElement("div"));
    const [isNotFullscreen, setIsNotFullscreen] = (0, import_react4.useState)(fscreen_esm_default.fullscreenElement === void 0 || fscreen_esm_default.fullscreenElement === null);
    const mitoContainerRef = (0, import_react4.useRef)(null);
    const width = props.width || "large";
    const widthPixels = WIDTH_MAPPING[width];
    (0, import_react4.useEffect)(() => {
      return () => {
        try {
          if (isNotFullscreen) {
            document.body.removeChild(dropdownContainerElement.current);
          } else {
            if (mitoContainerRef.current) {
              mitoContainerRef.current.removeChild(dropdownContainerElement.current);
            }
          }
        } catch (e) {
        }
      };
    }, []);
    const setRef = (0, import_react4.useCallback)((unsavedDropdownAnchor) => {
      if (unsavedDropdownAnchor !== null) {
        dropdownAnchor.current = unsavedDropdownAnchor;
        if (isNotFullscreen) {
          document.body.append(dropdownContainerElement.current);
        } else {
          const mitoContainer = unsavedDropdownAnchor.closest(".mito-container");
          if (mitoContainer) {
            mitoContainer.appendChild(dropdownContainerElement.current);
            mitoContainerRef.current = mitoContainer;
          }
        }
        updateDropdownPosition(unsavedDropdownAnchor);
      }
    }, []);
    (0, import_react4.useEffect)(() => {
      if (dropdownAnchor.current !== null) {
        updateDropdownPosition(dropdownAnchor.current);
      }
      const interval = setInterval(() => {
        if (dropdownAnchor.current !== null) {
          updateDropdownPosition(dropdownAnchor.current);
        }
      }, 25);
      return () => clearInterval(interval);
    }, [props.display]);
    (0, import_react4.useEffect)(() => {
      const handleChange = () => {
        var _a;
        setIsNotFullscreen(!fscreen_esm_default.fullscreenElement);
        if (!fscreen_esm_default.fullscreenElement) {
          document.body.append(dropdownContainerElement.current);
        } else {
          const mitoContainer = (_a = dropdownAnchor.current) == null ? void 0 : _a.closest(".mito-container");
          if (mitoContainer) {
            mitoContainer.appendChild(dropdownContainerElement.current);
            mitoContainerRef.current = mitoContainer;
          }
        }
        if (dropdownAnchor.current) {
          updateDropdownPosition(dropdownAnchor.current);
        }
      };
      fscreen_esm_default.addEventListener("fullscreenchange", handleChange);
      return () => fscreen_esm_default.removeEventListener("fullscreenchange", handleChange);
    }, []);
    const updateDropdownPosition = (dropdownContainer) => {
      const parentElement = dropdownContainer.parentElement || dropdownContainer;
      const parentBoundingClientRect = parentElement.getBoundingClientRect();
      const parentTop = parentBoundingClientRect.top;
      const parentBottom = parentBoundingClientRect.bottom;
      const parentLeft = parentBoundingClientRect.left;
      const parentRight = parentBoundingClientRect.right;
      let newBoundingRect = {
        top: void 0,
        bottom: void 0,
        right: void 0,
        left: void 0
      };
      if (topInBounds(parentBottom) && leftInBounds(parentLeft, widthPixels)) {
        newBoundingRect = {
          top: parentBottom,
          bottom: void 0,
          right: void 0,
          left: parentLeft
        };
      } else if (topInBounds(parentBottom) && rightInBounds(parentRight, widthPixels)) {
        newBoundingRect = {
          top: parentBottom,
          bottom: void 0,
          right: window.innerWidth - parentRight,
          left: void 0
        };
      } else if (bottomInBounds(parentTop) && leftInBounds(parentLeft, widthPixels)) {
        newBoundingRect = {
          top: void 0,
          bottom: window.innerHeight - parentTop,
          right: void 0,
          left: parentLeft
        };
      } else {
        newBoundingRect = {
          top: void 0,
          bottom: window.innerHeight - parentTop,
          right: window.innerWidth - parentRight,
          left: void 0
        };
      }
      setBoundingRect((oldBoundingRect) => {
        if (newBoundingRect.top !== oldBoundingRect.top || newBoundingRect.left !== oldBoundingRect.left || newBoundingRect.bottom !== oldBoundingRect.bottom || newBoundingRect.right !== oldBoundingRect.right) {
          return newBoundingRect;
        }
        return oldBoundingRect;
      });
    };
    const dropdownClassNames = classNames("mito-dropdown", `element-width-${width}`, {
      "mito-dropdown-compressed": import_react4.default.Children.count(props.children) > 4,
      "mito-dropdown-search": props.searchable === true
    });
    let found = 0;
    const childrenToDisplay = import_react4.default.Children.map(props.children, (child) => {
      if (child.props.isDropdownSectionSeperator) {
        return child;
      }
      const title = child.props.title;
      const inSearch = title !== void 0 && fuzzyMatch(title, searchString.toLowerCase()) > 0.8;
      if (inSearch) {
        const selected = found === selectedIndex;
        const finalChild = import_react4.default.cloneElement(child, {
          className: classNames(child.props.className, {
            "mito-dropdown-item-selected": selected
          })
        });
        found += 1;
        return finalChild;
      } else {
        return null;
      }
    });
    return /* @__PURE__ */ import_react4.default.createElement("div", { ref: setRef, tabIndex: 0 }, props.display && import_react_dom.default.createPortal(
      /* @__PURE__ */ import_react4.default.createElement(
        "div",
        {
          className: dropdownClassNames,
          style: {
            position: "absolute",
            top: boundingRect.top,
            bottom: boundingRect.bottom,
            right: boundingRect.right,
            left: boundingRect.left
          }
        },
        props.searchable && /* @__PURE__ */ import_react4.default.createElement("div", { className: classNames("mito-dropdown-search-input", DROPDOWN_IGNORE_CLICK_CLASS) }, /* @__PURE__ */ import_react4.default.createElement(
          Input_default,
          {
            value: searchString,
            placeholder: "Search",
            onKeyDown: (e) => {
              e.stopPropagation();
              handleKeyboardInDropdown(e, found, setSelectedIndex, props.closeDropdown);
            },
            onChange: (e) => {
              setSelectedIndex(-1);
              setSearchString(e.target.value);
            },
            autoFocus: true
          }
        )),
        childrenToDisplay.length > 0 && /* @__PURE__ */ import_react4.default.createElement("div", { className: "mito-dropdown-items-container" }, childrenToDisplay),
        found === 0 && /* @__PURE__ */ import_react4.default.createElement(Row_default, { justify: "center", style: { paddingTop: "50px" } }, /* @__PURE__ */ import_react4.default.createElement("p", { className: "text-body-2" }, "No options to display"))
      ),
      dropdownContainerElement.current
    ));
  };
  var Dropdown_default = Dropdown;

  // src/components/elements/DropdownItem.tsx
  var DropdownItem = (props) => {
    const disabled = props.disabled === true;
    const hideSubtext = props.hideSubtext === true;
    const displaySubtextOnHover = props.displaySubtextOnHover === true;
    return /* @__PURE__ */ import_react5.default.createElement(
      "div",
      {
        className: classNames("mito-dropdown-item", { [DROPDOWN_IGNORE_CLICK_CLASS]: disabled, [DROPDOWN_SUPRESS_FOCUS_ON_CLOSE]: props.supressFocusSettingOnClose }, props.className),
        onClick: !disabled ? props.onClick : void 0,
        title: props.tooltip
      },
      /* @__PURE__ */ import_react5.default.createElement("div", { className: classNames("mito-dropdown-item-icon-and-title-container") }, /* @__PURE__ */ import_react5.default.createElement("div", { className: classNames("mito-dropdown-item-icon-container") }, props.icon), /* @__PURE__ */ import_react5.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react5.default.createElement("span", { title: props.tooltip || props.title }, /* @__PURE__ */ import_react5.default.createElement("p", { className: classNames("text-body-2", "text-overflow-hide", "cursor-default", { "mito-dropdown-item-title-disabled": disabled }) }, props.title)), props.rightText && /* @__PURE__ */ import_react5.default.createElement("span", { className: classNames("mito-dropdown-item-right-text", "text-body-2") }, props.rightText))),
      props.subtext && /* @__PURE__ */ import_react5.default.createElement("div", { className: classNames(
        "mito-dropdown-item-subtext-container",
        "text-subtext-1",
        { "mito-dropdown-item-subtext-disabled": disabled },
        { "mito-dropdown-item-display-subtext-on-hover": hideSubtext && displaySubtextOnHover }
      ) }, props.subtext)
    );
  };
  var DropdownItem_default = DropdownItem;

  // src/components/taskpanes/Graph/GraphSetupTab.tsx
  var import_react22 = __toESM(require_react());

  // src/utils/objects.tsx
  function recurseObjectAssign(target, source) {
    Object.getOwnPropertyNames(source).forEach((key2) => {
      const sourceValue = source[key2];
      const targetValue = target[key2];
      if (typeof sourceValue === "object" && typeof targetValue === "object") {
        recurseObjectAssign(targetValue, sourceValue);
      } else {
        target[key2] = sourceValue;
      }
    });
    return target;
  }
  function updateObjectWithPartialObject(obj, update) {
    const newParams = window.structuredClone(obj);
    recurseObjectAssign(newParams, update);
    return newParams;
  }

  // src/components/elements/DataframeSelect.tsx
  var import_react9 = __toESM(require_react());

  // src/components/layout/Col.tsx
  var import_react6 = __toESM(require_react());
  var Col = (props) => {
    const width = props.span ? `${props.span / 24 * 100}%` : void 0;
    const marginLeft = props.offset ? `${props.offset / 24 * 100}%` : void 0;
    const marginRight = props.offsetRight ? `${props.offsetRight / 24 * 100}%` : void 0;
    return /* @__PURE__ */ import_react6.default.createElement(
      "div",
      {
        className: classNames("spacing-col", props.className),
        style: {
          width,
          marginLeft,
          marginRight,
          flex: props.flex
        },
        onClick: props.onClick,
        title: props.title
      },
      props.children
    );
  };
  var Col_default = Col;

  // src/components/elements/Select.tsx
  var import_react8 = __toESM(require_react());

  // src/components/icons/SelectDropdownIcon.tsx
  var import_react7 = __toESM(require_react());
  var SelectDropdownIcon = (props) => {
    if (props.purpleOrDarkOrWhite === "purple") {
      return /* @__PURE__ */ import_react7.default.createElement("svg", { width: "6", height: "4", viewBox: "0 0 6 4", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react7.default.createElement("path", { d: "M0 0L3.00283 4L6 0", fill: "#9D6CFF" }));
    } else if (props.purpleOrDarkOrWhite === "white") {
      return /* @__PURE__ */ import_react7.default.createElement("svg", { width: "6", height: "4", viewBox: "0 0 6 4", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react7.default.createElement("path", { d: "M0 0L3.00283 4L6 0", fill: "white" }));
    } else {
      return /* @__PURE__ */ import_react7.default.createElement("svg", { width: "6", height: "4", viewBox: "0 0 6 4", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react7.default.createElement("path", { d: "M0 0L3.00283 4L6 0", fill: "#343434" }));
    }
  };
  var SelectDropdownIcon_default = SelectDropdownIcon;

  // src/components/elements/Select.tsx
  var Select = (props) => {
    const [displayDropdown, setDisplayDropdown] = (0, import_react8.useState)(false);
    const width = props.width || "block";
    const widthClass = `element-width-${width}`;
    const dropdownActiveClass = displayDropdown ? "select-dropdown-active" : "";
    const providedClasses = props.className || "";
    let displayValue = props.value;
    const children = import_react8.default.Children.map(props.children, (child) => {
      const { id, title } = child.props;
      if (id === props.value) {
        displayValue = title;
      }
      const valueForOnChange = id !== void 0 ? id : title;
      const onChangeFunc = props.onChange;
      if (onChangeFunc === void 0) {
        return child;
      } else {
        const finalChild = import_react8.default.cloneElement(child, {
          onClick: () => {
            onChangeFunc(valueForOnChange);
          }
        });
        return finalChild;
      }
    });
    return /* @__PURE__ */ import_react8.default.createElement(
      "div",
      {
        className: classNames("select-container", "text-body-2", widthClass, dropdownActiveClass, providedClasses, { "select-disabled": props.disabled }),
        onClick: () => {
          if (props.disabled) {
            return;
          }
          setDisplayDropdown((prevDisplayDropdown) => {
            if (!prevDisplayDropdown) {
              return true;
            }
            return prevDisplayDropdown;
          });
        }
      },
      /* @__PURE__ */ import_react8.default.createElement("p", { className: "select-text" }, displayValue),
      /* @__PURE__ */ import_react8.default.createElement("div", { className: "select-dropdown-icon-container" }, /* @__PURE__ */ import_react8.default.createElement(SelectDropdownIcon_default, { purpleOrDarkOrWhite: "white" })),
      /* @__PURE__ */ import_react8.default.createElement(
        Dropdown_default,
        {
          display: displayDropdown,
          closeDropdown: () => setDisplayDropdown(false),
          searchable: props.searchable,
          width: props.dropdownWidth
        },
        children
      )
    );
  };
  var Select_default = Select;

  // src/components/elements/DataframeSelect.tsx
  var DataframeSelect = (props) => {
    const [dfNames] = (0, import_react9.useState)(
      () => props.sheetDataArray.map((sheetData) => sheetData.dfName).filter((dfName, sheetIndex) => {
        return sheetIndex !== props.sheetIndexToIgnore;
      })
    );
    return /* @__PURE__ */ import_react9.default.createElement(Row_default, { justify: "space-between", align: "center", title: props.title }, /* @__PURE__ */ import_react9.default.createElement(Col_default, null, /* @__PURE__ */ import_react9.default.createElement("p", { className: "text-header-3" }, "Dataframe")), /* @__PURE__ */ import_react9.default.createElement(Col_default, null, /* @__PURE__ */ import_react9.default.createElement(
      Select_default,
      {
        width: "medium",
        value: dfNames[props.sheetIndex],
        onChange: (newDfName) => {
          const newSheetIndex = dfNames.findIndex((dfName) => dfName === newDfName);
          if (newSheetIndex !== -1 && newSheetIndex !== props.sheetIndex) {
            props.onChange(newSheetIndex);
          }
        }
      },
      dfNames.map((dfName) => {
        return /* @__PURE__ */ import_react9.default.createElement(
          DropdownItem_default,
          {
            key: dfName,
            title: dfName
          }
        );
      })
    )));
  };
  var DataframeSelect_default = DataframeSelect;

  // src/components/elements/LabelAndTooltip.tsx
  var import_react12 = __toESM(require_react());

  // src/components/elements/Tooltip.tsx
  var import_react11 = __toESM(require_react());

  // src/components/icons/QuestionMarkIcon.tsx
  var import_react10 = __toESM(require_react());
  var QuestionMarkIcon = () => {
    return /* @__PURE__ */ import_react10.default.createElement("svg", { width: "20", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react10.default.createElement("path", { d: "M7.50018 11.5909C7.87674 11.5909 8.182 11.2856 8.182 10.9091C8.182 10.5325 7.87674 10.2273 7.50018 10.2273C7.12362 10.2273 6.81836 10.5325 6.81836 10.9091C6.81836 11.2856 7.12362 11.5909 7.50018 11.5909Z", fill: "#494650" }), /* @__PURE__ */ import_react10.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.74299 5.15462C7.41191 5.16915 7.23537 5.30235 7.17425 5.4322C7.0139 5.77291 6.60771 5.91912 6.267 5.75877C5.92629 5.59841 5.78008 5.19222 5.94044 4.85151C6.29647 4.09503 7.06347 3.81949 7.6832 3.79229C8.27933 3.76613 9.02119 3.95601 9.43162 4.49121C9.74745 4.90306 9.92489 5.42514 9.85323 5.97406C9.78058 6.53067 9.46309 7.02995 8.94794 7.40893C8.26004 7.91501 8.26125 8.17321 8.26143 8.21081C8.26143 8.21136 8.26144 8.21186 8.26144 8.21232C8.26144 8.58887 7.95618 8.89413 7.57962 8.89413C7.20306 8.89413 6.8978 8.58887 6.8978 8.21232C6.8978 7.56001 7.27722 6.94514 8.13987 6.31051C8.40503 6.11545 8.48394 5.92881 8.50107 5.79756C8.5192 5.65864 8.47982 5.49093 8.34953 5.32102C8.34036 5.30907 8.29056 5.25933 8.16587 5.21452C8.04681 5.17174 7.8971 5.14785 7.74299 5.15462Z", fill: "#494650" }), /* @__PURE__ */ import_react10.default.createElement("path", { d: "M7.5 15C3.34091 15 0 11.6591 0 7.5C0 3.34091 3.34091 0 7.5 0C11.6591 0 15 3.34091 15 7.5C15 11.6591 11.6591 15 7.5 15ZM7.5 1.36364C4.09091 1.36364 1.36364 4.09091 1.36364 7.5C1.36364 10.9091 4.09091 13.6364 7.5 13.6364C10.9091 13.6364 13.6364 10.9091 13.6364 7.5C13.6364 4.09091 10.9091 1.36364 7.5 1.36364Z", fill: "#494650" }));
  };
  var QuestionMarkIcon_default = QuestionMarkIcon;

  // src/components/elements/Tooltip.tsx
  var Tooltip = (props) => {
    return /* @__PURE__ */ import_react11.default.createElement(
      Row_default,
      {
        justify: "center",
        align: "center",
        title: props.title
      },
      /* @__PURE__ */ import_react11.default.createElement(QuestionMarkIcon_default, null)
    );
  };
  var Tooltip_default = Tooltip;

  // src/components/elements/LabelAndTooltip.tsx
  var LabelAndTooltip = (props) => {
    return /* @__PURE__ */ import_react12.default.createElement(Row_default, { justify: "start", align: "center", title: props.tooltip, suppressTopBottomMargin: true }, /* @__PURE__ */ import_react12.default.createElement(Col_default, null, /* @__PURE__ */ import_react12.default.createElement("p", { className: props.textBody ? "text-body-1" : "text-header-3" }, props.children)), /* @__PURE__ */ import_react12.default.createElement(Col_default, null, /* @__PURE__ */ import_react12.default.createElement(Tooltip_default, { title: props.tooltip })));
  };
  var LabelAndTooltip_default = LabelAndTooltip;

  // src/components/elements/Toggle.tsx
  var import_react13 = __toESM(require_react());
  var Toggle = (props) => {
    const disabled = props.disabled === true;
    const className = props.className !== void 0 ? props.className : "";
    return /* @__PURE__ */ import_react13.default.createElement("label", { className: classNames("toggle-label", className), style: props.height ? { "--toggle-height": props.height } : {} }, /* @__PURE__ */ import_react13.default.createElement(
      "input",
      {
        type: "checkbox",
        checked: props.value,
        onClick: () => {
          if (disabled) {
            return;
          }
          props.onChange();
        },
        onChange: () => {
        }
      }
    ), /* @__PURE__ */ import_react13.default.createElement("div", { className: classNames("toggle", { "toggle-disabled": disabled }) }));
  };
  var Toggle_default = Toggle;

  // src/components/layout/CollapsibleSection.tsx
  var import_react17 = __toESM(require_react());

  // src/components/icons/DownArrowIcon.tsx
  var import_react14 = __toESM(require_react());
  var DownArrowIcon = (props) => {
    const stroke = props.variant === "light" ? "var(--mito-white)" : "var(--mito-legacy-gray)";
    return /* @__PURE__ */ import_react14.default.createElement("svg", { width: "19", height: "11", viewBox: "0 0 19 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react14.default.createElement("path", { d: "M18 1.94141L9.49199 8.94141L1 1.94141", stroke, strokeWidth: "2", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var DownArrowIcon_default = DownArrowIcon;

  // src/components/icons/UpArrowIcon.tsx
  var import_react15 = __toESM(require_react());
  var UpArrowIcon = (props) => {
    const stroke = props.variant === "light" ? "var(--mito-white)" : "var(--mito-legacy-gray)";
    return /* @__PURE__ */ import_react15.default.createElement("svg", { width: "19", height: "10", viewBox: "0 0 19 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react15.default.createElement("path", { d: "M1 8.94141L9.50801 1.94141L18 8.94141", stroke, strokeWidth: "2", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var UpArrowIcon_default = UpArrowIcon;

  // src/components/icons/ProIcon.tsx
  var import_react16 = __toESM(require_react());
  var ProIcon = () => {
    return /* @__PURE__ */ import_react16.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react16.default.createElement("path", { d: "M4.70455 13V7.18182H6.67045C7.12689 7.18182 7.5 7.2642 7.78977 7.42898C8.08144 7.59186 8.29735 7.8125 8.4375 8.09091C8.57765 8.36932 8.64773 8.67992 8.64773 9.02273C8.64773 9.36553 8.57765 9.67708 8.4375 9.95739C8.29924 10.2377 8.08523 10.4612 7.79545 10.6278C7.50568 10.7926 7.13447 10.875 6.68182 10.875H5.27273V10.25H6.65909C6.97159 10.25 7.22254 10.196 7.41193 10.0881C7.60133 9.98011 7.73864 9.83428 7.82386 9.65057C7.91098 9.46496 7.95455 9.25568 7.95455 9.02273C7.95455 8.78977 7.91098 8.58144 7.82386 8.39773C7.73864 8.21402 7.60038 8.07008 7.40909 7.96591C7.2178 7.85985 6.96402 7.80682 6.64773 7.80682H5.40909V13H4.70455ZM9.69176 13V8.63636H10.3395V9.29545H10.3849C10.4645 9.07955 10.6084 8.90436 10.8168 8.76989C11.0251 8.63542 11.2599 8.56818 11.5213 8.56818C11.5705 8.56818 11.6321 8.56913 11.706 8.57102C11.7798 8.57292 11.8357 8.57576 11.8736 8.57955V9.26136C11.8509 9.25568 11.7988 9.24716 11.7173 9.2358C11.6378 9.22254 11.5535 9.21591 11.4645 9.21591C11.2524 9.21591 11.063 9.26042 10.8963 9.34943C10.7315 9.43655 10.6009 9.55777 10.5043 9.71307C10.4096 9.86648 10.3622 10.0417 10.3622 10.2386V13H9.69176ZM14.3082 13.0909C13.9143 13.0909 13.5687 12.9972 13.2713 12.8097C12.9759 12.6222 12.7448 12.3598 12.5781 12.0227C12.4134 11.6856 12.331 11.2917 12.331 10.8409C12.331 10.3864 12.4134 9.98958 12.5781 9.65057C12.7448 9.31155 12.9759 9.0483 13.2713 8.8608C13.5687 8.6733 13.9143 8.57955 14.3082 8.57955C14.7022 8.57955 15.0469 8.6733 15.3423 8.8608C15.6397 9.0483 15.8707 9.31155 16.0355 9.65057C16.2022 9.98958 16.2855 10.3864 16.2855 10.8409C16.2855 11.2917 16.2022 11.6856 16.0355 12.0227C15.8707 12.3598 15.6397 12.6222 15.3423 12.8097C15.0469 12.9972 14.7022 13.0909 14.3082 13.0909ZM14.3082 12.4886C14.6075 12.4886 14.8537 12.4119 15.0469 12.2585C15.2401 12.1051 15.383 11.9034 15.4759 11.6534C15.5687 11.4034 15.6151 11.1326 15.6151 10.8409C15.6151 10.5492 15.5687 10.2775 15.4759 10.0256C15.383 9.77367 15.2401 9.57008 15.0469 9.41477C14.8537 9.25947 14.6075 9.18182 14.3082 9.18182C14.009 9.18182 13.7628 9.25947 13.5696 9.41477C13.3764 9.57008 13.2334 9.77367 13.1406 10.0256C13.0478 10.2775 13.0014 10.5492 13.0014 10.8409C13.0014 11.1326 13.0478 11.4034 13.1406 11.6534C13.2334 11.9034 13.3764 12.1051 13.5696 12.2585C13.7628 12.4119 14.009 12.4886 14.3082 12.4886Z", fill: "#9D6CFF" }), /* @__PURE__ */ import_react16.default.createElement("path", { d: "M19.25 10C19.25 15.1086 15.1086 19.25 10 19.25C4.89137 19.25 0.75 15.1086 0.75 10C0.75 4.89137 4.89137 0.75 10 0.75C15.1086 0.75 19.25 4.89137 19.25 10Z", stroke: "#9D6CFF", strokeWidth: "1.5" }));
  };
  var ProIcon_default = ProIcon;

  // src/components/layout/CollapsibleSection.tsx
  var CollapsibleSection = (props) => {
    const [open, setOpen] = (0, import_react17.useState)(props.open || false);
    (0, import_react17.useEffect)(() => {
      if (props.open !== void 0) {
        setOpen(props.open);
      }
    }, [props.open]);
    if (open) {
      return /* @__PURE__ */ import_react17.default.createElement(
        "div",
        {
          className: "mito-blue-container"
        },
        /* @__PURE__ */ import_react17.default.createElement(Row_default, { justify: "space-between", align: "center", onClick: () => {
          setOpen(false);
        } }, /* @__PURE__ */ import_react17.default.createElement(Col_default, null, /* @__PURE__ */ import_react17.default.createElement(Row_default, { suppressTopBottomMargin: true }, typeof props.title === "string" && /* @__PURE__ */ import_react17.default.createElement("div", { className: "text-header-3" }, props.title), typeof props.title !== "string" && props.title, "\xA0 ", props.proSection && !props.isPro && /* @__PURE__ */ import_react17.default.createElement(ProIcon_default, null))), /* @__PURE__ */ import_react17.default.createElement(Col_default, null, /* @__PURE__ */ import_react17.default.createElement(UpArrowIcon_default, null))),
        props.children
      );
    } else {
      return /* @__PURE__ */ import_react17.default.createElement(
        "div",
        {
          className: "mito-blue-container",
          onClick: () => {
            setOpen(true);
          }
        },
        /* @__PURE__ */ import_react17.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react17.default.createElement(Col_default, null, /* @__PURE__ */ import_react17.default.createElement(Row_default, { suppressTopBottomMargin: true }, typeof props.title === "string" && /* @__PURE__ */ import_react17.default.createElement("div", { className: "text-header-3" }, props.title), typeof props.title !== "string" && props.title, "\xA0 ", props.proSection && !props.isPro && /* @__PURE__ */ import_react17.default.createElement(ProIcon_default, null))), /* @__PURE__ */ import_react17.default.createElement(Col_default, null, /* @__PURE__ */ import_react17.default.createElement(DownArrowIcon_default, null)))
      );
    }
  };
  var CollapsibleSection_default = CollapsibleSection;

  // src/components/taskpanes/Graph/AxisSection.tsx
  var import_react21 = __toESM(require_react());

  // src/components/elements/DropdownButton.tsx
  var import_react18 = __toESM(require_react());
  var DropdownButton = (props) => {
    const [displayDropdown, setDisplayDropdown] = (0, import_react18.useState)(false);
    const width = props.width || "block";
    const widthClass = `element-width-${width}`;
    const disabledClass = props.disabled ? "mito-dropdown-button-disabled" : "mito-dropdown-button-enabled";
    return /* @__PURE__ */ import_react18.default.createElement(
      "div",
      {
        className: classNames("mito-dropdown-button", "text-header-4", widthClass, disabledClass),
        onClick: () => {
          setDisplayDropdown((prevDisplayDropdown) => {
            if (!props.disabled && !prevDisplayDropdown) {
              return true;
            }
            return prevDisplayDropdown;
          });
        }
      },
      /* @__PURE__ */ import_react18.default.createElement("p", { className: "mito-dropdown-button-text" }, props.text),
      /* @__PURE__ */ import_react18.default.createElement("div", { className: "mito-dropdown-button-icon-container" }, /* @__PURE__ */ import_react18.default.createElement(SelectDropdownIcon_default, { purpleOrDarkOrWhite: props.disabled ? "dark" : "purple" })),
      /* @__PURE__ */ import_react18.default.createElement(
        Dropdown_default,
        {
          display: displayDropdown,
          closeDropdown: () => setDisplayDropdown(false),
          searchable: props.searchable,
          width: props.dropdownWidth
        },
        props.children
      )
    );
  };
  var DropdownButton_default = DropdownButton;

  // src/components/elements/SelectAndXIconCard.tsx
  var import_react20 = __toESM(require_react());

  // src/components/icons/XIcon.tsx
  var import_react19 = __toESM(require_react());
  var XIcon = (props) => {
    const stroke = props.variant === "light" ? "var(--mito-white)" : "var(--mito-legacy-gray)";
    return /* @__PURE__ */ import_react19.default.createElement("svg", { width: props.width || "18", onClick: props.onClick, height: props.height || "18", viewBox: "0 0 13 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement("line", { x1: "0.707107", y1: "1.29289", x2: "11.3136", y2: "11.8994", stroke, strokeWidth: "2" }), /* @__PURE__ */ import_react19.default.createElement("line", { x1: "0.7072", y1: "11.8995", x2: "11.3137", y2: "1.29297", stroke, strokeWidth: "2" }));
  };
  var XIcon_default = XIcon;

  // src/components/elements/SelectAndXIconCard.tsx
  var SelectAndXIconCard = (props) => {
    return /* @__PURE__ */ import_react20.default.createElement(Row_default, { key: props.value, justify: "space-between", align: "center" }, /* @__PURE__ */ import_react20.default.createElement(Col_default, { flex: "1" }, /* @__PURE__ */ import_react20.default.createElement(
      Select_default,
      {
        value: props.value + "",
        onChange: (newID) => {
          props.onChange(newID);
        },
        searchable: true
      },
      props.selectableValues.map((id) => {
        const title = props.titleMap ? props.titleMap[id] : id;
        return /* @__PURE__ */ import_react20.default.createElement(
          DropdownItem_default,
          {
            key: id,
            id,
            title
          }
        );
      })
    )), /* @__PURE__ */ import_react20.default.createElement(Col_default, { offset: 1, offsetRight: 1 }, /* @__PURE__ */ import_react20.default.createElement(
      XIcon_default,
      {
        onClick: props.onDelete
      }
    )));
  };
  var SelectAndXIconCard_default = SelectAndXIconCard;

  // src/components/taskpanes/Graph/AxisSection.tsx
  var AxisSection = (props) => {
    const selectableColumnIDs = Object.keys(props.columnIDsMap || {});
    const selectedColumnHeaderSelects = props.selectedColumnIDs.map((columnID, i) => {
      return /* @__PURE__ */ import_react21.default.createElement(
        SelectAndXIconCard_default,
        {
          key: i,
          value: columnID,
          titleMap: columnIDMapToDisplayHeadersMap(props.columnIDsMap),
          onChange: (columnID2) => {
            props.updateAxisData(
              props.graphAxis,
              i,
              columnID2
            );
          },
          onDelete: () => props.updateAxisData(props.graphAxis, i),
          selectableValues: selectableColumnIDs
        }
      );
    });
    const numSelectedColumns = props.selectedColumnIDs.length;
    const numOtherAxisSelectedColumns = props.otherAxisSelectedColumnIDs.length;
    const disabledDueToMaxSeriesReachedBool = numSelectedColumns + numOtherAxisSelectedColumns >= 10;
    return /* @__PURE__ */ import_react21.default.createElement("div", null, /* @__PURE__ */ import_react21.default.createElement(
      Row_default,
      {
        justify: "space-between",
        align: "center",
        title: `Select columns to graph on the ${props.graphAxis}.`
      },
      /* @__PURE__ */ import_react21.default.createElement(Col_default, null, /* @__PURE__ */ import_react21.default.createElement("div", { className: "text-header-3" }, props.graphAxis)),
      /* @__PURE__ */ import_react21.default.createElement(Col_default, null, /* @__PURE__ */ import_react21.default.createElement(
        DropdownButton_default,
        {
          text: "+ Add",
          width: "small",
          disabled: disabledDueToMaxSeriesReachedBool,
          searchable: true
        },
        selectableColumnIDs.map((columnID) => {
          const columnHeader = props.columnIDsMap[columnID];
          return /* @__PURE__ */ import_react21.default.createElement(
            DropdownItem_default,
            {
              key: columnID,
              title: getDisplayColumnHeader(columnHeader),
              onClick: () => {
                props.updateAxisData(
                  props.graphAxis,
                  props.selectedColumnIDs.length,
                  columnID
                );
              }
            }
          );
        })
      ))
    ), disabledDueToMaxSeriesReachedBool && /* @__PURE__ */ import_react21.default.createElement("div", { className: "text-subtext-1 text-align-left" }, "You can only graph ten series at once."), selectedColumnHeaderSelects);
  };
  var AxisSection_default = AxisSection;

  // src/components/taskpanes/Graph/GraphSetupTab.tsx
  var GRAPH_SAFETY_FILTER_CUTOFF = 1e3;
  var SAFETY_FILTER_DISABLED_MESSAGE = `Because you\u2019re graphing less than ${GRAPH_SAFETY_FILTER_CUTOFF} rows of data, you can safely graph your data without applying a filter first.`;
  var SAFETY_FILTER_ENABLED_MESSAGE = `Turning on Limit ${GRAPH_SAFETY_FILTER_CUTOFF} rows only graphs the first ${GRAPH_SAFETY_FILTER_CUTOFF} rows of your dataframe, ensuring that your browser tab won\u2019t crash. Turning it off graphs the entire dataframe and may slow or crash your browser tab.`;
  var GRAPHS_THAT_DONT_SUPPORT_COLOR = ["density heatmap" /* DENSITY_HEATMAP */];
  var GRAPHS_THAT_HAVE_NBINS = ["histogram" /* HISTOGRAM */];
  var GRAPHS_THAT_HAVE_BARMODE = ["bar" /* BAR */, "histogram" /* HISTOGRAM */];
  var GRAPHS_THAT_HAVE_BARNORM = ["bar" /* BAR */, "histogram" /* HISTOGRAM */];
  var GRAPHS_THAT_HAVE_HISTNORM = ["histogram" /* HISTOGRAM */];
  var GRAPHS_THAT_HAVE_HISTFUNC = ["histogram" /* HISTOGRAM */];
  var GRAPHS_THAT_HAVE_POINTS = ["box" /* BOX */, "violin" /* VIOLIN */];
  var GRAPHS_THAT_HAVE_LINE_SHAPE = ["line" /* LINE */];
  var GRAPHS_WITH_UNIQUE_CONFIG_OPTIONS = [.../* @__PURE__ */ new Set([
    ...GRAPHS_THAT_HAVE_NBINS,
    ...GRAPHS_THAT_HAVE_BARMODE,
    ...GRAPHS_THAT_HAVE_BARNORM,
    ...GRAPHS_THAT_HAVE_HISTNORM,
    ...GRAPHS_THAT_HAVE_HISTFUNC,
    ...GRAPHS_THAT_HAVE_POINTS,
    ...GRAPHS_THAT_HAVE_LINE_SHAPE
  ])];
  function GraphSetupTab(props) {
    var _a;
    const graphSheetIndex = props.graphParams.graphCreation.sheet_index;
    const graphPreprocessingParams = props.graphParams.graphPreprocessing;
    const updateAxisData = (graphAxis, index, columnID) => {
      let axisColumnIDs = [];
      if (graphAxis === "X axis" /* X_AXIS */) {
        axisColumnIDs = props.graphParams.graphCreation.x_axis_column_ids;
      } else {
        axisColumnIDs = props.graphParams.graphCreation.y_axis_column_ids;
      }
      const axisColumnIDsCopy = [...axisColumnIDs];
      if (columnID === void 0) {
        axisColumnIDsCopy.splice(index, 1);
      } else {
        axisColumnIDsCopy[index] = columnID;
      }
      if (graphAxis === "X axis" /* X_AXIS */) {
        props.setGraphParams((prevGraphParams) => {
          const graphParamsCopy = window.structuredClone(prevGraphParams);
          return __spreadProps(__spreadValues({}, graphParamsCopy), {
            graphCreation: __spreadProps(__spreadValues({}, graphParamsCopy.graphCreation), {
              x_axis_column_ids: axisColumnIDsCopy
            })
          });
        });
      } else {
        props.setGraphParams((prevGraphParams) => {
          const graphParamsCopy = window.structuredClone(prevGraphParams);
          return __spreadProps(__spreadValues({}, graphParamsCopy), {
            graphCreation: __spreadProps(__spreadValues({}, graphParamsCopy.graphCreation), {
              y_axis_column_ids: axisColumnIDsCopy
            })
          });
        });
      }
      props.setGraphUpdatedNumber((old) => old + 1);
    };
    const setGraphType = (graphType) => {
      const xAxisColumnIDsCopy = [...props.graphParams.graphCreation.x_axis_column_ids];
      const yAxisColumnIDsCopy = [...props.graphParams.graphCreation.y_axis_column_ids];
      props.setGraphParams((prevGraphParams) => {
        const graphParamsCopy = window.structuredClone(prevGraphParams);
        return __spreadProps(__spreadValues({}, graphParamsCopy), {
          graphCreation: __spreadProps(__spreadValues({}, graphParamsCopy.graphCreation), {
            graph_type: graphType,
            x_axis_column_ids: xAxisColumnIDsCopy,
            y_axis_column_ids: yAxisColumnIDsCopy,
            color: GRAPHS_THAT_DONT_SUPPORT_COLOR.includes(graphType) ? void 0 : graphParamsCopy.graphCreation.color,
            points: GRAPHS_THAT_HAVE_POINTS.includes(graphType) ? "outliers" : void 0,
            line_shape: GRAPHS_THAT_HAVE_LINE_SHAPE.includes(graphType) ? "linear" : void 0,
            nbins: void 0,
            histnorm: void 0,
            histfunc: GRAPHS_THAT_HAVE_HISTFUNC.includes(graphType) ? "count" : void 0
          }),
          graphStyling: __spreadProps(__spreadValues({}, graphParamsCopy.graphStyling), {
            barmode: GRAPHS_THAT_HAVE_BARMODE.includes(graphType) ? "group" : void 0,
            barnorm: void 0
          })
        });
      });
      props.setGraphUpdatedNumber((old) => old + 1);
    };
    const setColor = (newColorColumnID) => {
      props.setGraphParams((prevGraphParams) => {
        const graphParamsCopy = window.structuredClone(prevGraphParams);
        return __spreadProps(__spreadValues({}, graphParamsCopy), {
          graphCreation: __spreadProps(__spreadValues({}, graphParamsCopy.graphCreation), {
            color: newColorColumnID
          })
        });
      });
      props.setGraphUpdatedNumber((old) => old + 1);
    };
    function updateGraphParam(update) {
      props.setGraphParams((prevGraphParams) => {
        return updateObjectWithPartialObject(prevGraphParams, update);
      });
      props.setGraphUpdatedNumber((old) => old + 1);
    }
    const colorByColumnTooltip = GRAPHS_THAT_DONT_SUPPORT_COLOR.includes(props.graphParams.graphCreation.graph_type) ? `${props.graphParams.graphCreation.graph_type} does not support further breaking down data using color.` : "Use an additional column to further breakdown the data by color.";
    const columnIDsMap = props.columnIDsMapArray[graphSheetIndex] || {};
    return /* @__PURE__ */ import_react22.default.createElement(import_react22.Fragment, null, /* @__PURE__ */ import_react22.default.createElement("div", { className: "graph-sidebar-toolbar-content" }, /* @__PURE__ */ import_react22.default.createElement(
      DataframeSelect_default,
      {
        title: "Select the data sheet to graph.",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: graphSheetIndex,
        onChange: (newSheetIndex) => {
          const newSheetGraphParams = getDefaultGraphParams(props.sheetDataArray, newSheetIndex, props.graphParams.graphCreation.graph_type);
          props.setGraphParams(newSheetGraphParams);
          props.setGraphUpdatedNumber((old) => old + 1);
        }
      }
    ), /* @__PURE__ */ import_react22.default.createElement(
      Row_default,
      {
        justify: "space-between",
        align: "center",
        title: "Select one of many Plotly graphs to create."
      },
      /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement("p", { className: "text-header-3" }, "Chart Type")),
      /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement(
        Select_default,
        {
          value: props.graphParams.graphCreation.graph_type,
          onChange: (graphType) => {
            setGraphType(graphType);
          },
          width: "small",
          dropdownWidth: "medium"
        },
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "bar" /* BAR */
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "line" /* LINE */
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "scatter" /* SCATTER */
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "histogram" /* HISTOGRAM */
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "density heatmap" /* DENSITY_HEATMAP */
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "density contour" /* DENSITY_CONTOUR */
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "box" /* BOX */
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "violin" /* VIOLIN */
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "strip" /* STRIP */
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "ecdf" /* ECDF */
          }
        )
      ))
    ), /* @__PURE__ */ import_react22.default.createElement(
      AxisSection_default,
      {
        columnIDsMap,
        graphType: props.graphParams.graphCreation.graph_type,
        graphAxis: "X axis" /* X_AXIS */,
        selectedColumnIDs: props.graphParams.graphCreation.x_axis_column_ids,
        otherAxisSelectedColumnIDs: props.graphParams.graphCreation.y_axis_column_ids,
        updateAxisData,
        mitoAPI: props.mitoAPI
      }
    ), /* @__PURE__ */ import_react22.default.createElement(
      AxisSection_default,
      {
        columnIDsMap,
        graphType: props.graphParams.graphCreation.graph_type,
        graphAxis: "Y axis" /* Y_AXIS */,
        selectedColumnIDs: props.graphParams.graphCreation.y_axis_column_ids,
        otherAxisSelectedColumnIDs: props.graphParams.graphCreation.x_axis_column_ids,
        updateAxisData,
        mitoAPI: props.mitoAPI
      }
    ), /* @__PURE__ */ import_react22.default.createElement("div", null, /* @__PURE__ */ import_react22.default.createElement(
      Row_default,
      {
        justify: "space-between",
        align: "center",
        title: colorByColumnTooltip,
        suppressTopBottomMargin: true
      },
      /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement(LabelAndTooltip_default, { tooltip: colorByColumnTooltip }, "Color By Column")),
      /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement(
        Select_default,
        {
          value: props.graphParams.graphCreation.color ? getDisplayColumnHeader(columnIDsMap[props.graphParams.graphCreation.color]) : "None",
          disabled: GRAPHS_THAT_DONT_SUPPORT_COLOR.includes(props.graphParams.graphCreation.graph_type),
          width: "small",
          searchable: true
        },
        getColorDropdownItems(graphSheetIndex, props.columnIDsMapArray, props.columnDtypesMap, setColor)
      ))
    )), /* @__PURE__ */ import_react22.default.createElement(
      Row_default,
      {
        justify: "space-between",
        align: "center",
        title: getDefaultSafetyFilter(props.sheetDataArray, graphSheetIndex) ? SAFETY_FILTER_ENABLED_MESSAGE : SAFETY_FILTER_DISABLED_MESSAGE
      },
      /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement(LabelAndTooltip_default, { tooltip: getDefaultSafetyFilter(props.sheetDataArray, graphSheetIndex) ? SAFETY_FILTER_ENABLED_MESSAGE : SAFETY_FILTER_DISABLED_MESSAGE }, `Limit ${GRAPH_SAFETY_FILTER_CUTOFF} rows`)),
      /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement(
        Toggle_default,
        {
          value: props.graphParams.graphPreprocessing.safety_filter_turned_on_by_user,
          onChange: () => {
            updateGraphParam({ graphPreprocessing: { safety_filter_turned_on_by_user: !graphPreprocessingParams.safety_filter_turned_on_by_user } });
          },
          disabled: !getDefaultSafetyFilter(props.sheetDataArray, graphSheetIndex)
        }
      ))
    ), GRAPHS_WITH_UNIQUE_CONFIG_OPTIONS.includes(props.graphParams.graphCreation.graph_type) && /* @__PURE__ */ import_react22.default.createElement(
      CollapsibleSection_default,
      {
        title: getGraphTypeFullName(props.graphParams.graphCreation.graph_type) + " configuration"
      },
      GRAPHS_THAT_HAVE_NBINS.includes(props.graphParams.graphCreation.graph_type) && /* @__PURE__ */ import_react22.default.createElement(Row_default, { justify: "space-between", align: "center", title: "Number of bins in histogram" }, /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement("p", null, "Number of bins (int)")), /* @__PURE__ */ import_react22.default.createElement(
        Input_default,
        {
          value: ((_a = props.graphParams.graphCreation.nbins) == null ? void 0 : _a.toString()) || "",
          type: "number",
          placeholder: "5",
          onChange: (e) => {
            const newNumberBins = e.target.value === "" ? void 0 : e.target.value;
            updateGraphParam({ graphCreation: { nbins: newNumberBins } });
          },
          width: "small"
        }
      )),
      GRAPHS_THAT_HAVE_BARMODE.includes(props.graphParams.graphCreation.graph_type) && /* @__PURE__ */ import_react22.default.createElement(Row_default, { justify: "space-between", align: "center", title: "How bars are grouped together when there are multiple" }, /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement(LabelAndTooltip_default, { tooltip: "How bars are grouped together when there are multiple", textBody: true }, "Bar mode")), /* @__PURE__ */ import_react22.default.createElement(
        Select_default,
        {
          value: props.graphParams.graphStyling.barmode || "group",
          onChange: (newBarMode) => {
            updateGraphParam({ graphStyling: { barmode: newBarMode } });
          },
          width: "small",
          dropdownWidth: "medium"
        },
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "stack"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "group"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "overlay"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "relative"
          }
        )
      )),
      GRAPHS_THAT_HAVE_BARNORM.includes(props.graphParams.graphCreation.graph_type) && /* @__PURE__ */ import_react22.default.createElement(Row_default, { justify: "space-between", align: "center", title: "Normalize strategy used for each group of bars at a specific location on the graph's domain" }, /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement(LabelAndTooltip_default, { tooltip: "Normalize strategy used for each group of bars at a specific location on the graph's domain", textBody: true }, "Bar normalization")), /* @__PURE__ */ import_react22.default.createElement(
        Select_default,
        {
          value: props.graphParams.graphStyling.barnorm || "none",
          onChange: (newBarNorm) => {
            if (newBarNorm === "none") {
              updateGraphParam({ graphStyling: { barnorm: void 0 } });
              return;
            }
            updateGraphParam({ graphStyling: { barnorm: newBarNorm } });
          },
          width: "small",
          dropdownWidth: "medium"
        },
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "none"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "fraction",
            subtext: "value of each bar divided by the sum of all values at that location"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "percent",
            subtext: "fraction multiplied by 100"
          }
        )
      )),
      GRAPHS_THAT_HAVE_HISTNORM.includes(props.graphParams.graphCreation.graph_type) && /* @__PURE__ */ import_react22.default.createElement(Row_default, { justify: "space-between", align: "center", title: "Normalization strategy used for each graphed series in the histogram" }, /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement(LabelAndTooltip_default, { tooltip: "Normalization strategy used for each graphed series in the histogram", textBody: true }, "Hist normalization")), /* @__PURE__ */ import_react22.default.createElement(
        Select_default,
        {
          value: props.graphParams.graphCreation.histnorm || "none",
          onChange: (newHistnorm) => {
            if (newHistnorm === "none") {
              updateGraphParam({ graphCreation: { histnorm: void 0 } });
              return;
            }
            updateGraphParam({ graphCreation: { histnorm: newHistnorm } });
          },
          width: "small",
          dropdownWidth: "medium"
        },
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "none"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "probability",
            subtext: "occurrences in bin divided by total number of sample points"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "percent",
            subtext: "probabilty multiplied by 100"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "density",
            subtext: "occurences in bin divided by bin interval"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "probability density",
            subtext: "probability that a point falls into bin"
          }
        )
      )),
      GRAPHS_THAT_HAVE_HISTFUNC.includes(props.graphParams.graphCreation.graph_type) && /* @__PURE__ */ import_react22.default.createElement(Row_default, { justify: "space-between", align: "center", title: "The metric displayed for each bin of data" }, /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement(LabelAndTooltip_default, { tooltip: "The metric displayed for each bin of data", textBody: true }, "Hist Function")), /* @__PURE__ */ import_react22.default.createElement(
        Select_default,
        {
          value: props.graphParams.graphCreation.histfunc || "count",
          onChange: (newHistfunc) => {
            updateGraphParam({ graphCreation: { histfunc: newHistfunc } });
          },
          width: "small",
          dropdownWidth: "medium"
        },
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "count",
            subtext: "number of values in each bin"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "sum",
            subtext: "sum of values in each bin"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "avg",
            subtext: "average value in each bin"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "min",
            subtext: "min value in each bin"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "max",
            subtext: "max value in each bin"
          }
        )
      )),
      GRAPHS_THAT_HAVE_POINTS.includes(props.graphParams.graphCreation.graph_type) && /* @__PURE__ */ import_react22.default.createElement(Row_default, { justify: "space-between", align: "center", title: "Display outlier points" }, /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement("p", null, "Points")), /* @__PURE__ */ import_react22.default.createElement(
        Select_default,
        {
          value: props.graphParams.graphCreation.points === false ? "none" : props.graphParams.graphCreation.points !== void 0 ? props.graphParams.graphCreation.points : "",
          onChange: (newPointsString) => {
            const newPointsParams = newPointsString === "false" ? false : newPointsString;
            updateGraphParam({ graphCreation: { points: newPointsParams } });
          },
          width: "small",
          dropdownWidth: "medium"
        },
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "outliers",
            subtext: "only display sample points outside the whiskers"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "supsected outliers",
            id: "suspectedoutliers",
            subtext: "display outlier and suspected outlier points"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "all",
            subtext: "display all sample points"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "none",
            id: "false",
            subtext: "display no individual sample points"
          }
        )
      )),
      GRAPHS_THAT_HAVE_LINE_SHAPE.includes(props.graphParams.graphCreation.graph_type) && /* @__PURE__ */ import_react22.default.createElement(Row_default, { justify: "space-between", align: "center", title: "The shape of the line" }, /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement("p", null, "Line shape")), /* @__PURE__ */ import_react22.default.createElement(
        Select_default,
        {
          value: props.graphParams.graphCreation.line_shape || "linear",
          onChange: (newLineShape) => {
            updateGraphParam({ graphCreation: { line_shape: newLineShape } });
          },
          width: "small",
          dropdownWidth: "medium"
        },
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "linear",
            subtext: "straight line between points"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "spline",
            subtext: "spline interpolation between points"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "hv",
            subtext: "horizontal vertical"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "vh",
            subtext: "veritical horizontal"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "hvh",
            subtext: "horizontal vertical horizontal"
          }
        ),
        /* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            title: "vhv",
            subtext: "vertical horizontal vertical"
          }
        )
      ))
    ), /* @__PURE__ */ import_react22.default.createElement(CollapsibleSection_default, { title: "Facet plots" }, /* @__PURE__ */ import_react22.default.createElement("div", null, /* @__PURE__ */ import_react22.default.createElement(
      Row_default,
      {
        justify: "space-between",
        align: "center",
        title: "Create subplots based on this attribute"
      },
      /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement(LabelAndTooltip_default, { tooltip: "Create subplots based on this attribute", textBody: true }, "Facet Column")),
      /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement(
        Select_default,
        {
          value: props.graphParams.graphCreation.facet_col_column_id ? getDisplayColumnHeader(columnIDsMap[props.graphParams.graphCreation.facet_col_column_id]) : "None",
          width: "small",
          searchable: true
        },
        [/* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            key: "None",
            title: "None",
            onClick: () => {
              updateGraphParam({ graphCreation: { facet_col_column_id: void 0 } });
            }
          }
        )].concat(
          (Object.keys(columnIDsMap) || []).map((columnID) => {
            const columnHeader = columnIDsMap[columnID];
            return /* @__PURE__ */ import_react22.default.createElement(
              DropdownItem_default,
              {
                key: columnID,
                title: getDisplayColumnHeader(columnHeader),
                onClick: () => {
                  updateGraphParam({ graphCreation: { facet_col_column_id: columnID } });
                }
              }
            );
          })
        )
      ))
    )), /* @__PURE__ */ import_react22.default.createElement("div", null, /* @__PURE__ */ import_react22.default.createElement(
      Row_default,
      {
        justify: "space-between",
        align: "center",
        title: "Create subplots based on this attribute"
      },
      /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement(LabelAndTooltip_default, { tooltip: "Create subplots based on this attribute", textBody: true }, "Facet row")),
      /* @__PURE__ */ import_react22.default.createElement(Col_default, null, /* @__PURE__ */ import_react22.default.createElement(
        Select_default,
        {
          value: props.graphParams.graphCreation.facet_row_column_id ? getDisplayColumnHeader(columnIDsMap[props.graphParams.graphCreation.facet_row_column_id]) : "None",
          width: "small",
          searchable: true
        },
        [/* @__PURE__ */ import_react22.default.createElement(
          DropdownItem_default,
          {
            key: "None",
            title: "None",
            onClick: () => {
              updateGraphParam({ graphCreation: { facet_row_column_id: void 0 } });
            }
          }
        )].concat(
          (Object.keys(columnIDsMap) || []).map((columnID) => {
            const columnHeader = columnIDsMap[columnID];
            return /* @__PURE__ */ import_react22.default.createElement(
              DropdownItem_default,
              {
                key: columnID,
                title: getDisplayColumnHeader(columnHeader),
                onClick: () => {
                  updateGraphParam({ graphCreation: { facet_row_column_id: columnID } });
                }
              }
            );
          })
        )
      ))
    )))));
  }
  var GraphSetupTab_default = GraphSetupTab;

  // src/components/taskpanes/Graph/graphUtils.tsx
  var DO_NOT_CHANGE_PAPER_BGCOLOR_DEFAULT = "#FFFFFF";
  var DO_NOT_CHANGE_PLOT_BGCOLOR_DEFAULT = "#E6EBF5";
  var DO_NOT_CHANGE_TITLE_FONT_COLOR_DEFAULT = "#2F3E5D";
  var getDefaultGraphParams = (sheetDataArray2, sheetIndex, graphType) => {
    graphType = graphType || "bar" /* BAR */;
    return {
      graphPreprocessing: {
        safety_filter_turned_on_by_user: true
      },
      graphCreation: {
        graph_type: graphType,
        sheet_index: sheetIndex,
        x_axis_column_ids: [],
        y_axis_column_ids: [],
        color: void 0,
        facet_col_column_id: void 0,
        facet_row_column_id: void 0,
        facet_col_wrap: void 0,
        facet_col_spacing: void 0,
        facet_row_spacing: void 0,
        points: GRAPHS_THAT_HAVE_POINTS.includes(graphType) ? "outliers" : void 0,
        line_shape: GRAPHS_THAT_HAVE_LINE_SHAPE.includes(graphType) ? "linear" : void 0,
        nbins: void 0,
        histnorm: void 0,
        histfunc: GRAPHS_THAT_HAVE_HISTFUNC.includes(graphType) ? "count" : void 0
      },
      graphStyling: {
        title: {
          title: void 0,
          visible: true,
          title_font_color: DO_NOT_CHANGE_TITLE_FONT_COLOR_DEFAULT
        },
        xaxis: {
          title: void 0,
          visible: true,
          title_font_color: DO_NOT_CHANGE_TITLE_FONT_COLOR_DEFAULT,
          type: void 0,
          showgrid: true,
          gridwidth: void 0,
          rangeslider: {
            visible: true
          }
        },
        yaxis: {
          title: void 0,
          visible: true,
          title_font_color: DO_NOT_CHANGE_TITLE_FONT_COLOR_DEFAULT,
          type: void 0,
          showgrid: true,
          gridwidth: void 0
        },
        showlegend: true,
        legend: {
          title: {
            text: void 0
          },
          orientation: "v",
          x: void 0,
          y: void 0
        },
        paper_bgcolor: DO_NOT_CHANGE_PAPER_BGCOLOR_DEFAULT,
        plot_bgcolor: DO_NOT_CHANGE_PLOT_BGCOLOR_DEFAULT,
        barmode: GRAPHS_THAT_HAVE_BARMODE.includes(graphType) ? "group" : void 0,
        barnorm: void 0
      }
    };
  };
  var getDefaultSafetyFilter = (sheetDataArray2, sheetIndex) => {
    return sheetDataArray2[sheetIndex] === void 0 || sheetDataArray2[sheetIndex].numRows > GRAPH_SAFETY_FILTER_CUTOFF;
  };
  var getGraphParams = (graphDataDict, graphID, selectedSheetIndex, sheetDataArray2) => {
    var _a;
    const graphParamsCopy = window.structuredClone((_a = graphDataDict[graphID]) == null ? void 0 : _a.graphParams);
    const graphDataSourceSheetIndex = graphParamsCopy !== void 0 ? graphParamsCopy.graphCreation.sheet_index : selectedSheetIndex;
    if (graphParamsCopy !== void 0) {
      const validColumnIDs = sheetDataArray2[graphDataSourceSheetIndex] !== void 0 ? sheetDataArray2[graphDataSourceSheetIndex].data.map((c) => c.columnID) : [];
      const xAxisColumnIDs = intersection(
        validColumnIDs,
        graphParamsCopy.graphCreation.x_axis_column_ids
      );
      const yAxisColumnIDs = intersection(
        validColumnIDs,
        graphParamsCopy.graphCreation.y_axis_column_ids
      );
      const color = graphParamsCopy.graphCreation.color !== void 0 && validColumnIDs.includes(graphParamsCopy.graphCreation.color) ? graphParamsCopy.graphCreation.color : void 0;
      return __spreadProps(__spreadValues({}, graphParamsCopy), {
        graphCreation: __spreadProps(__spreadValues({}, graphParamsCopy.graphCreation), {
          x_axis_column_ids: xAxisColumnIDs,
          y_axis_column_ids: yAxisColumnIDs,
          color
        })
      });
    }
    return getDefaultGraphParams(sheetDataArray2, graphDataSourceSheetIndex);
  };
  var getColorDropdownItems = (graphSheetIndex, columnIDsMapArray, columnDtypesMap, setColor) => {
    const NoneOption = [/* @__PURE__ */ import_react23.default.createElement(
      DropdownItem_default,
      {
        key: "None",
        title: "None",
        onClick: () => setColor(void 0)
      }
    )];
    const columnDropdownItems = Object.keys(columnIDsMapArray[graphSheetIndex] || {}).map((columnID) => {
      const columnHeader = columnIDsMapArray[graphSheetIndex][columnID];
      const disabled = isDatetimeDtype(columnDtypesMap[columnID]);
      return /* @__PURE__ */ import_react23.default.createElement(
        DropdownItem_default,
        {
          key: columnID,
          title: getDisplayColumnHeader(columnHeader),
          onClick: () => setColor(columnID),
          disabled,
          subtext: disabled ? "Dates cannot be used as the color breakdown property" : "",
          hideSubtext: true,
          displaySubtextOnHover: true
        }
      );
    });
    return NoneOption.concat(columnDropdownItems);
  };
  var getGraphTypeFullName = (graphType) => {
    switch (graphType) {
      case "bar" /* BAR */:
        return "Bar chart";
      case "box" /* BOX */:
        return "Box plot";
      case "density contour" /* DENSITY_CONTOUR */:
        return "Density contour";
      case "density heatmap" /* DENSITY_HEATMAP */:
        return "Density heatmap";
      case "ecdf" /* ECDF */:
        return "ECDF";
      case "histogram" /* HISTOGRAM */:
        return "Histogram";
      case "line" /* LINE */:
        return "Line chart";
      case "scatter" /* SCATTER */:
        return "Scatter plot";
      case "strip" /* STRIP */:
        return "Strip plot";
      case "violin" /* VIOLIN */:
        return "Violin plot";
    }
  };
  var convertFrontendtoBackendGraphParams = (graphParamsFrontend) => {
    const graphCreationParams = graphParamsFrontend.graphCreation;
    const graphStylingParams = graphParamsFrontend.graphStyling;
    const x = __spreadProps(__spreadValues({}, graphParamsFrontend), {
      graphCreation: __spreadProps(__spreadValues({}, graphParamsFrontend.graphCreation), {
        facet_col_wrap: convertStringToFloatOrUndefined(graphCreationParams.facet_col_wrap),
        facet_col_spacing: convertStringToFloatOrUndefined(graphCreationParams.facet_col_spacing),
        facet_row_spacing: convertStringToFloatOrUndefined(graphCreationParams.facet_row_spacing),
        nbins: convertStringToFloatOrUndefined(graphCreationParams.nbins)
      }),
      graphStyling: __spreadProps(__spreadValues({}, graphParamsFrontend.graphStyling), {
        xaxis: __spreadProps(__spreadValues({}, graphParamsFrontend.graphStyling.xaxis), {
          gridwidth: convertStringToFloatOrUndefined(graphStylingParams.xaxis.gridwidth)
        }),
        yaxis: __spreadProps(__spreadValues({}, graphParamsFrontend.graphStyling.yaxis), {
          gridwidth: convertStringToFloatOrUndefined(graphStylingParams.yaxis.gridwidth)
        }),
        legend: __spreadProps(__spreadValues({}, graphParamsFrontend.graphStyling.legend), {
          x: convertStringToFloatOrUndefined(graphStylingParams.legend.x),
          y: convertStringToFloatOrUndefined(graphStylingParams.legend.y)
        })
      })
    });
    return x;
  };
  var convertBackendtoFrontendGraphParams = (graphParamsFrontend) => {
    const graphCreationParams = graphParamsFrontend.graphCreation;
    const graphStylingParams = graphParamsFrontend.graphStyling;
    return __spreadProps(__spreadValues({}, graphParamsFrontend), {
      graphCreation: __spreadProps(__spreadValues({}, graphParamsFrontend.graphCreation), {
        facet_col_wrap: convertToStringOrUndefined(graphCreationParams.facet_col_wrap),
        facet_col_spacing: convertToStringOrUndefined(graphCreationParams.facet_col_spacing),
        facet_row_spacing: convertToStringOrUndefined(graphCreationParams.facet_row_spacing),
        nbins: convertToStringOrUndefined(graphCreationParams.nbins)
      }),
      graphStyling: __spreadProps(__spreadValues({}, graphParamsFrontend.graphStyling), {
        xaxis: __spreadProps(__spreadValues({}, graphParamsFrontend.graphStyling.xaxis), {
          gridwidth: convertToStringOrUndefined(graphStylingParams.xaxis.gridwidth)
        }),
        yaxis: __spreadProps(__spreadValues({}, graphParamsFrontend.graphStyling.yaxis), {
          gridwidth: convertToStringOrUndefined(graphStylingParams.yaxis.gridwidth)
        }),
        legend: __spreadProps(__spreadValues({}, graphParamsFrontend.graphStyling.legend), {
          x: convertToStringOrUndefined(graphStylingParams.legend.x),
          y: convertToStringOrUndefined(graphStylingParams.legend.y)
        })
      })
    });
  };

  // src/utils/code.tsx
  function getCodeString(analysisName, code, telemetryEnabled) {
    if (code.length == 0) {
      return "";
    }
    let finalCode = "";
    const isCommentLine = (codeLine) => {
      return codeLine.startsWith("#") && codeLine.indexOf("\n") === -1;
    };
    if (code.length > 0) {
      for (let i = 0; i < code.length; i++) {
        if (isCommentLine(code[i])) {
          finalCode += "\n";
        }
        finalCode += code[i] + "\n";
      }
    }
    if (telemetryEnabled) {
      return `from mitosheet import *; register_analysis("${analysisName}");
${finalCode}`;
    } else {
      return `from mitosheet import *; # Analysis Name:${analysisName};
${finalCode}`;
    }
  }
  function getLastNonEmptyLine(codeText) {
    const filteredActiveText = codeText.split(/\r?\n/).filter((line) => line.trim().length > 0);
    return filteredActiveText.length > 0 ? filteredActiveText.pop() : void 0;
  }
  var getArgsFromMitosheetCallCode = (codeText) => {
    let nameString = codeText.split("sheet(")[1].split(")")[0];
    if (nameString.includes("analysis_to_replay")) {
      nameString = nameString.split("analysis_to_replay")[0].trim();
    }
    if (nameString.includes("view_df")) {
      nameString = nameString.split("view_df")[0].trim();
    }
    let args = nameString.split(",").map((dfName) => dfName.trim());
    args = args.filter((dfName) => {
      return dfName.length > 0;
    });
    return args;
  };
  function isMitosheetCallCode(codeText) {
    const lastLine = getLastNonEmptyLine(codeText);
    if (lastLine === void 0) {
      return false;
    }
    return lastLine.indexOf("sheet(") !== -1;
  }
  function isMitoAnalysisCode(codeText) {
    return codeText.startsWith("# MITO CODE START") || codeText.startsWith("from mitosheet import *; register_analysis(") || codeText.startsWith("from mitosheet import *; # Analysis:") || codeText.startsWith("from mitosheet import *; # Analysis Name:");
  }
  function containsMitosheetCallWithSpecificAnalysisToReplay(codeText, analysisName) {
    return codeText.includes("sheet(") && codeText.includes(`analysis_to_replay="${analysisName}"`);
  }
  function containsMitosheetCallWithAnyAnalysisToReplay(codeText) {
    return isMitosheetCallCode(codeText) && codeText.includes(`analysis_to_replay=`);
  }
  function containsGeneratedCodeOfAnalysis(codeText, analysisName) {
    return isMitoAnalysisCode(codeText) && codeText.includes(analysisName);
  }

  // src/jupyter/notebook/extensionUtils.tsx
  function getCellAtIndex(index) {
    var _a, _b;
    return (_b = (_a = window.Jupyter) == null ? void 0 : _a.notebook) == null ? void 0 : _b.get_cell(index);
  }
  function getCellText(cell) {
    return (cell == null ? void 0 : cell.get_text()) || "";
  }
  function isEmptyCell(cell) {
    if (cell === void 0) {
      return false;
    }
    const currentCode = getCellText(cell);
    return currentCode.trim() === "";
  }
  function getCellCallingMitoshetWithAnalysis(analysisName) {
    var _a, _b;
    const cells = (_b = (_a = window.Jupyter) == null ? void 0 : _a.notebook) == null ? void 0 : _b.get_cells();
    if (cells === void 0) {
      return void 0;
    }
    let cellIndex = 0;
    for (const cell of cells) {
      if (containsMitosheetCallWithSpecificAnalysisToReplay(getCellText(cell), analysisName)) {
        return [cell, cellIndex];
      }
      cellIndex++;
    }
    return void 0;
  }
  function getMostLikelyMitosheetCallingCell(analysisName) {
    var _a, _b, _c, _d, _e, _f, _g, _h;
    if (analysisName) {
      const mitosheetCallCellAndIndex = getCellCallingMitoshetWithAnalysis(analysisName);
      if (mitosheetCallCellAndIndex !== void 0) {
        return mitosheetCallCellAndIndex;
      }
    }
    const cells = (_b = (_a = window.Jupyter) == null ? void 0 : _a.notebook) == null ? void 0 : _b.get_cells();
    if (cells == void 0) {
      return;
    }
    const activeCell = (_f = (_c = window.Jupyter) == null ? void 0 : _c.notebook) == null ? void 0 : _f.get_cell((_e = (_d = window.Jupyter) == null ? void 0 : _d.notebook) == null ? void 0 : _e.get_anchor_index());
    const activeCellIndex = ((_h = (_g = window.Jupyter) == null ? void 0 : _g.notebook) == null ? void 0 : _h.get_anchor_index()) || 0;
    const previousCell = getCellAtIndex(activeCellIndex - 1);
    if (previousCell && isMitosheetCallCode(getCellText(previousCell)) && !containsMitosheetCallWithAnyAnalysisToReplay(getCellText(previousCell))) {
      return [previousCell, activeCellIndex - 1];
    }
    if (activeCell && isMitosheetCallCode(getCellText(activeCell)) && !containsMitosheetCallWithAnyAnalysisToReplay(getCellText(activeCell))) {
      return [activeCell, activeCellIndex];
    }
    let index = activeCellIndex;
    while (index >= 0) {
      const cell = getCellAtIndex(index);
      if (cell && isMitosheetCallCode(getCellText(cell)) && !containsMitosheetCallWithAnyAnalysisToReplay(getCellText(cell))) {
        return [cell, index];
      }
      index--;
    }
    return void 0;
  }
  function writeToCell(cell, code) {
    if (cell == void 0) {
      return;
    }
    cell.set_text(code);
  }
  function tryOverwriteAnalysisToReplayParameter(cell, oldAnalysisName, newAnalysisName) {
    if (isMitosheetCallCode(getCellText(cell)) && containsMitosheetCallWithSpecificAnalysisToReplay(getCellText(cell), oldAnalysisName)) {
      const currentCode = getCellText(cell);
      const newCode = currentCode.replace(
        `analysis_to_replay="${oldAnalysisName}")`,
        `analysis_to_replay="${newAnalysisName}")`
      );
      writeToCell(cell, newCode);
      return true;
    }
    return false;
  }
  function tryWriteAnalysisToReplayParameter(cell, analysisName) {
    if (isMitosheetCallCode(getCellText(cell)) && !containsMitosheetCallWithAnyAnalysisToReplay(getCellText(cell))) {
      const currentCode = getCellText(cell);
      const lastIndex = currentCode.lastIndexOf(")");
      let replacement = ``;
      if (currentCode.includes("sheet()")) {
        replacement = `analysis_to_replay="${analysisName}")`;
      } else {
        replacement = `, analysis_to_replay="${analysisName}")`;
      }
      const newCode = currentCode.substring(0, lastIndex) + replacement + currentCode.substring(lastIndex + 1);
      writeToCell(cell, newCode);
      return true;
    }
    return false;
  }
  var notebookGetArgs = (analysisToReplayName) => {
    const cellAndIndex = getMostLikelyMitosheetCallingCell(analysisToReplayName);
    if (cellAndIndex) {
      const [cell] = cellAndIndex;
      return getArgsFromMitosheetCallCode(getCellText(cell));
    } else {
      return [];
    }
  };
  var notebookWriteAnalysisToReplayToMitosheetCall = (analysisName, mitoAPI) => {
    const cellAndIndex = getMostLikelyMitosheetCallingCell(analysisName);
    if (cellAndIndex) {
      const [cell] = cellAndIndex;
      const written = tryWriteAnalysisToReplayParameter(cell, analysisName);
      if (written) {
        return;
      }
    }
    void mitoAPI.log("write_analysis_to_replay_to_mitosheet_call_failed");
  };
  var notebookOverwriteAnalysisToReplayToMitosheetCall = (oldAnalysisName, newAnalysisName, mitoAPI) => {
    const mitosheetCallCellAndIndex = getCellCallingMitoshetWithAnalysis(oldAnalysisName);
    if (mitosheetCallCellAndIndex === void 0) {
      return;
    }
    const [mitosheetCallCell] = mitosheetCallCellAndIndex;
    const overwritten = tryOverwriteAnalysisToReplayParameter(mitosheetCallCell, oldAnalysisName, newAnalysisName);
    if (!overwritten) {
      void mitoAPI.log("overwrite_analysis_to_replay_to_mitosheet_call_failed");
    }
  };
  var notebookWriteGeneratedCodeToCell = (analysisName, codeLines, telemetryEnabled) => {
    var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
    const code = getCodeString(analysisName, codeLines, telemetryEnabled);
    const mitosheetCallCellAndIndex = getCellCallingMitoshetWithAnalysis(analysisName);
    if (mitosheetCallCellAndIndex === void 0) {
      return;
    }
    const [, mitosheetCallIndex] = mitosheetCallCellAndIndex;
    const cells = (_b = (_a = window.Jupyter) == null ? void 0 : _a.notebook) == null ? void 0 : _b.get_cells();
    if (cells === void 0) {
      return;
    }
    const activeCellIndex = ((_d = (_c = window.Jupyter) == null ? void 0 : _c.notebook) == null ? void 0 : _d.get_anchor_index()) || 0;
    const codeCell = getCellAtIndex(mitosheetCallIndex + 1);
    if (isEmptyCell(codeCell) || containsGeneratedCodeOfAnalysis(getCellText(codeCell), analysisName)) {
      writeToCell(codeCell, code);
    } else {
      if (mitosheetCallIndex !== activeCellIndex) {
        if (mitosheetCallIndex < activeCellIndex) {
          for (let i = 0; i < activeCellIndex - mitosheetCallIndex; i++) {
            (_f = (_e = window.Jupyter) == null ? void 0 : _e.notebook) == null ? void 0 : _f.select_prev();
          }
        } else if (mitosheetCallIndex > activeCellIndex) {
          for (let i = 0; i < mitosheetCallIndex - activeCellIndex; i++) {
            (_h = (_g = window.Jupyter) == null ? void 0 : _g.notebook) == null ? void 0 : _h.select_next();
          }
        }
      }
      (_j = (_i = window.Jupyter) == null ? void 0 : _i.notebook) == null ? void 0 : _j.insert_cell_below();
      (_l = (_k = window.Jupyter) == null ? void 0 : _k.notebook) == null ? void 0 : _l.select_next();
      const activeCell = (_p = (_m = window.Jupyter) == null ? void 0 : _m.notebook) == null ? void 0 : _p.get_cell((_o = (_n = window.Jupyter) == null ? void 0 : _n.notebook) == null ? void 0 : _o.get_anchor_index());
      writeToCell(activeCell, code);
    }
  };
  var notebookWriteCodeSnippetCell = (analysisName, code) => {
    var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
    const mitosheetCallCellAndIndex = getCellCallingMitoshetWithAnalysis(analysisName);
    if (mitosheetCallCellAndIndex === void 0) {
      return;
    }
    const [, mitosheetCallIndex] = mitosheetCallCellAndIndex;
    const cells = (_b = (_a = window.Jupyter) == null ? void 0 : _a.notebook) == null ? void 0 : _b.get_cells();
    if (cells === void 0) {
      return;
    }
    const codeCell = getCellAtIndex(mitosheetCallIndex + 1);
    if (isEmptyCell(codeCell)) {
      writeToCell(codeCell, code);
    } else {
      (_d = (_c = window.Jupyter) == null ? void 0 : _c.notebook) == null ? void 0 : _d.select_next();
      (_f = (_e = window.Jupyter) == null ? void 0 : _e.notebook) == null ? void 0 : _f.insert_cell_below();
      (_h = (_g = window.Jupyter) == null ? void 0 : _g.notebook) == null ? void 0 : _h.select_next();
      const activeCell = (_l = (_i = window.Jupyter) == null ? void 0 : _i.notebook) == null ? void 0 : _l.get_cell((_k = (_j = window.Jupyter) == null ? void 0 : _j.notebook) == null ? void 0 : _k.get_anchor_index());
      writeToCell(activeCell, code);
    }
  };

  // src/jupyter/jupyterUtils.tsx
  var isInJupyterLab = () => {
    return window.location.pathname.startsWith("/lab") || window.commands !== void 0 || window._JUPYTERLAB !== void 0;
  };
  var isInJupyterNotebook = () => {
    return window.location.pathname.startsWith("/notebooks") || window.Jupyter !== void 0;
  };
  var writeAnalysisToReplayToMitosheetCall = (analysisName, mitoAPI) => {
    var _a;
    if (isInJupyterLab()) {
      (_a = window.commands) == null ? void 0 : _a.execute("mitosheet:write-analysis-to-replay-to-mitosheet-call", {
        analysisName,
        mitoAPI
      });
    } else if (isInJupyterNotebook()) {
      notebookWriteAnalysisToReplayToMitosheetCall(analysisName, mitoAPI);
    } else {
      console.error("Not detected as in Jupyter Notebook or JupyterLab");
    }
  };
  var overwriteAnalysisToReplayToMitosheetCall = (oldAnalysisName, newAnalysisName, mitoAPI) => {
    var _a;
    if (isInJupyterLab()) {
      (_a = window.commands) == null ? void 0 : _a.execute("mitosheet:overwrite-analysis-to-replay-to-mitosheet-call", {
        oldAnalysisName,
        newAnalysisName,
        mitoAPI
      });
    } else if (isInJupyterNotebook()) {
      notebookOverwriteAnalysisToReplayToMitosheetCall(oldAnalysisName, newAnalysisName, mitoAPI);
    } else {
      console.error("Not detected as in Jupyter Notebook or JupyterLab");
    }
  };
  var writeGeneratedCodeToCell = (analysisName, code, telemetryEnabled) => {
    var _a;
    if (isInJupyterLab()) {
      (_a = window.commands) == null ? void 0 : _a.execute("mitosheet:write-generated-code-cell", {
        analysisName,
        code,
        telemetryEnabled
      });
    } else if (isInJupyterNotebook()) {
      notebookWriteGeneratedCodeToCell(analysisName, code, telemetryEnabled);
    } else {
      console.error("Not detected as in Jupyter Notebook or JupyterLab");
    }
  };
  var writeCodeSnippetCell = (analysisName, code) => {
    var _a;
    if (isInJupyterLab()) {
      (_a = window.commands) == null ? void 0 : _a.execute("mitosheet:write-code-snippet-cell", {
        analysisName,
        code
      });
    } else if (isInJupyterNotebook()) {
      notebookWriteCodeSnippetCell(analysisName, code);
    } else {
      console.error("Not detected as in Jupyter Notebook or JupyterLab");
    }
  };
  var getArgs = (analysisToReplayName) => {
    return new Promise((resolve) => {
      var _a;
      if (isInJupyterLab()) {
        (_a = window.commands) == null ? void 0 : _a.execute("mitosheet:get-args", { analysisToReplayName }).then(async (args) => {
          return resolve(args);
        });
        return;
      } else if (isInJupyterNotebook()) {
        return resolve(notebookGetArgs(analysisToReplayName));
      } else {
        console.error("Not detected as in Jupyter Notebook or JupyterLab");
      }
      return resolve([]);
    });
  };
  var getSheetDataArrayFromString = (sheet_data_json) => {
    if (sheet_data_json.length === 0) {
      return [];
    }
    return JSON.parse(sheet_data_json);
  };
  var getUserProfileFromString = (user_profile_json) => {
    const userProfile2 = JSON.parse(user_profile_json);
    if (userProfile2["usageTriggeredFeedbackID"] == "") {
      userProfile2["usageTriggeredFeedbackID"] = void 0;
    }
    return userProfile2;
  };
  var getAnalysisDataFromString = (analysis_data_json) => {
    const parsed = JSON.parse(analysis_data_json);
    const graphDataDict = {};
    Object.entries(parsed["graphDataDict"]).map(([graphID, graphDataBackend]) => {
      const graphDataBackendTyped = graphDataBackend;
      const graphParamsBackend = graphDataBackendTyped["graphParams"];
      const graphParamsFrontend = convertBackendtoFrontendGraphParams(graphParamsBackend);
      graphDataDict[graphID] = __spreadProps(__spreadValues({}, graphDataBackendTyped), {
        graphParams: graphParamsFrontend
      });
    });
    parsed["graphDataDict"] = graphDataDict;
    return parsed;
  };

  // src/types.tsx
  var UpdateType = /* @__PURE__ */ ((UpdateType2) => {
    UpdateType2["Undo"] = "undo";
    UpdateType2["Redo"] = "redo";
    UpdateType2["Clear"] = "clear";
    UpdateType2["ArgsUpdate"] = "args_update";
    UpdateType2["SaveAnalysisUpdate"] = "save_analysis_update";
    UpdateType2["ReplayAnalysisUpdate"] = "replay_analysis_update";
    UpdateType2["CheckoutStepByIdxUpdate"] = "checkout_step_by_idx_update";
    UpdateType2["AppendUserFieldUpdate"] = "append_user_field_update";
    UpdateType2["SetUserFieldUpdate"] = "set_user_field_update";
    UpdateType2["UpdateFeedbackv2ObjObject"] = "update_feedback_v2_obj_update";
    UpdateType2["GoPro"] = "go_pro";
    UpdateType2["RenderCountUpdate"] = "render_count_update";
    UpdateType2["ChecklistUpdate"] = "checklist_update";
    UpdateType2["UpdateExistingImportUpdate"] = "update_existing_import_update";
    return UpdateType2;
  })(UpdateType || {});
  var AggregationType = /* @__PURE__ */ ((AggregationType2) => {
    AggregationType2["COUNT"] = "count";
    AggregationType2["COUNT_UNIQUE"] = "count unique";
    AggregationType2["SUM"] = "sum";
    AggregationType2["MEAN"] = "mean";
    AggregationType2["MEDIAN"] = "median";
    AggregationType2["STD"] = "std";
    AggregationType2["MIN"] = "min";
    AggregationType2["MAX"] = "max";
    return AggregationType2;
  })(AggregationType || {});

  // src/hooks/useDebouncedEffect.tsx
  var import_react24 = __toESM(require_react());
  var useDebouncedEffect = (effect, deps, delay) => {
    (0, import_react24.useEffect)(() => {
      let cleanup = () => {
      };
      const handler = setTimeout(() => {
        const result = effect();
        if (result instanceof Object) {
          cleanup = result;
        }
      }, delay);
      return () => {
        clearTimeout(handler);
        cleanup();
      };
    }, [...deps || [], delay]);
  };

  // src/hooks/useKeyboardShortcuts.tsx
  var KEYBOARD_SHORTCUTS = {
    "c": "copy" /* Copy */,
    "z": "undo" /* Undo */,
    "y": "redo" /* Redo */
  };
  var JUPYTER_LAB_SHORTCUTS_DEFINED_ELSEWHERE = ["z", "y"];
  var useKeyboardShortcuts = (mitoContainerRef, actions, setGridState) => {
    useDebouncedEffect(() => {
      const checkKeyboardShortCut = (e) => {
        var _a, _b, _c;
        if (!Object.keys(KEYBOARD_SHORTCUTS).includes(e.key) || !e.ctrlKey && !e.metaKey) {
          return;
        }
        if (e.key === "c") {
          setGridState((prevGridState) => {
            return __spreadProps(__spreadValues({}, prevGridState), {
              copiedSelections: []
            });
          });
        }
        if (!((_a = mitoContainerRef.current) == null ? void 0 : _a.contains(document.activeElement))) {
          return;
        }
        if (JUPYTER_LAB_SHORTCUTS_DEFINED_ELSEWHERE.includes(e.key) && isInJupyterLab()) {
          return;
        }
        if (((_b = document.activeElement) == null ? void 0 : _b.tagName.toLowerCase()) === "input") {
          return;
        }
        const selectedText = (_c = window.getSelection()) == null ? void 0 : _c.toString();
        if (e.key === "c" && selectedText !== void 0 && selectedText !== "") {
          return;
        }
        e.stopImmediatePropagation();
        e.stopPropagation();
        e.preventDefault();
        actions[KEYBOARD_SHORTCUTS[e.key]].actionFunction();
      };
      document.addEventListener("keydown", checkKeyboardShortCut);
      return () => {
        document.removeEventListener("keydown", checkKeyboardShortCut);
      };
    }, [actions], 50);
  };

  // src/pro/taskpanes/ConditionalFormatting/ConditionalFormattingTaskpane.tsx
  var import_react82 = __toESM(require_react());

  // src/hooks/useLiveUpdatingParams.tsx
  var import_react26 = __toESM(require_react());

  // src/utils/time.tsx
  var MINUTE = 60;
  var HOUR = 60 * MINUTE;
  var DAY = 24 * HOUR;
  var WEEK = 7 * DAY;
  var MONTH = 4 * WEEK;
  var YEAR = 365 * DAY;
  var getLastModifiedString = (timestamp) => {
    if (timestamp === null || timestamp === void 0) {
      return "--";
    }
    const delta = Math.floor(Date.now() / 1e3) - timestamp;
    if (delta < HOUR) {
      const numMinutes = Math.round(delta / MINUTE);
      return `${numMinutes} minutes ago`;
    } else if (delta < DAY) {
      const numHours = Math.round(delta / HOUR);
      return `${numHours} hours ago`;
    } else if (delta < WEEK) {
      const numDays = Math.round(delta / DAY);
      return `${numDays} days ago`;
    } else if (delta < MONTH) {
      const numWeeks = Math.round(delta / WEEK);
      return `${numWeeks} weeks ago`;
    } else if (delta < YEAR) {
      const numMonths = Math.round(delta / MONTH);
      return `${numMonths} months ago`;
    } else {
      const numYears = Math.round(delta / YEAR);
      return `${numYears} years ago`;
    }
  };
  var sleep = async (timeoutInMilliseconds) => {
    await new Promise((resolve) => setTimeout(resolve, timeoutInMilliseconds));
  };
  var waitUntilConditionReturnsTrueOrTimeout = async (condition, timeoutInMilliseconds) => {
    let isConditionMet = await condition();
    for (let i = 0; i < timeoutInMilliseconds / 200 && !isConditionMet; i++) {
      if (!isConditionMet) {
        await sleep(timeoutInMilliseconds / 200);
      } else {
        break;
      }
      isConditionMet = await condition();
    }
    return isConditionMet;
  };

  // src/jupyter/comm.tsx
  var MAX_WAIT_FOR_COMM_CREATION = 1e4;
  var getNotebookCommConnectedToBackend = async (comm) => {
    return new Promise((resolve) => {
      const checkForEcho = async () => {
        let echoReceived = false;
        comm.on_msg((msg) => {
          if (msg.content.data.echo) {
            echoReceived = true;
          }
        });
        await waitUntilConditionReturnsTrueOrTimeout(() => {
          return echoReceived;
        }, MAX_WAIT_FOR_COMM_CREATION);
        return resolve(echoReceived);
      };
      void checkForEcho();
    });
  };
  var getNotebookComm = async (commTargetID2) => {
    var _a, _b, _c, _d;
    let potentialComm = (_d = (_c = (_b = (_a = window.Jupyter) == null ? void 0 : _a.notebook) == null ? void 0 : _b.kernel) == null ? void 0 : _c.comm_manager) == null ? void 0 : _d.new_comm(commTargetID2);
    await waitUntilConditionReturnsTrueOrTimeout(async () => {
      var _a2, _b2, _c2, _d2;
      potentialComm = (_d2 = (_c2 = (_b2 = (_a2 = window.Jupyter) == null ? void 0 : _a2.notebook) == null ? void 0 : _b2.kernel) == null ? void 0 : _c2.comm_manager) == null ? void 0 : _d2.new_comm(commTargetID2);
      return potentialComm !== void 0;
    }, MAX_WAIT_FOR_COMM_CREATION);
    if (potentialComm === void 0) {
      return "non_working_extension_error";
    } else {
      if (!await getNotebookCommConnectedToBackend(potentialComm)) {
        return "no_backend_comm_registered_error";
      }
      return {
        "type": "notebook",
        "comm": potentialComm
      };
    }
  };
  var getLabCommConnectedToBackend = async (comm) => {
    return new Promise((resolve) => {
      const checkForEcho = async () => {
        const originalOnMsg = comm.onMsg;
        let echoReceived = false;
        comm.onMsg = (msg) => {
          if (msg.content.data.echo) {
            echoReceived = true;
          }
        };
        await waitUntilConditionReturnsTrueOrTimeout(() => {
          return echoReceived;
        }, MAX_WAIT_FOR_COMM_CREATION);
        comm.onMsg = originalOnMsg;
        return resolve(echoReceived);
      };
      void checkForEcho();
    });
  };
  var getLabComm = async (kernelID2, commTargetID2) => {
    let potentialComm = void 0;
    await waitUntilConditionReturnsTrueOrTimeout(async () => {
      var _a;
      try {
        potentialComm = await ((_a = window.commands) == null ? void 0 : _a.execute("mitosheet:create-mitosheet-comm", { kernelID: kernelID2, commTargetID: commTargetID2 }));
      } catch (e) {
        console.error(e);
        return true;
      }
      return potentialComm !== void 0 && potentialComm !== "no_backend_comm_registered_error";
    }, MAX_WAIT_FOR_COMM_CREATION);
    if (potentialComm === void 0) {
      return "non_working_extension_error";
    } else if (potentialComm === "no_backend_comm_registered_error") {
      return "no_backend_comm_registered_error";
    } else {
      potentialComm.open();
      if (!await getLabCommConnectedToBackend(potentialComm)) {
        return "no_backend_comm_registered_error";
      } else {
        return {
          "type": "lab",
          "comm": potentialComm
        };
      }
    }
  };
  var getCommContainer = async (kernelID2, commTargetID2) => {
    if (isInJupyterNotebook()) {
      return getNotebookComm(commTargetID2);
    } else if (isInJupyterLab()) {
      return getLabComm(kernelID2, commTargetID2);
    }
    return "non_valid_location_error";
  };

  // src/jupyter/api.tsx
  var MAX_DELAY = 5 * 6e4;
  var RETRY_DELAY = 250;
  var MAX_RETRIES = MAX_DELAY / RETRY_DELAY;
  var getRandomId = () => {
    return "_" + Math.random().toString(36).substr(2, 9);
  };
  var MitoAPI = class {
    constructor(setSheetDataArray, setAnalysisData, setUserProfile, setUIState) {
      this.setSheetDataArray = setSheetDataArray;
      this.setAnalysisData = setAnalysisData;
      this.setUserProfile = setUserProfile;
      this.setUIState = setUIState;
      this.unconsumedResponses = [];
    }
    async init(commContainer) {
      this.commContainer = commContainer;
      this._send = commContainer.comm.send;
      if (commContainer.type === "notebook") {
        commContainer.comm.on_msg((msg) => this.receiveResponse(msg));
      } else {
        commContainer.comm.onMsg = (msg) => this.receiveResponse(msg);
      }
    }
    async send(msg, { maxRetries = MAX_RETRIES, doNotWaitForReply = false }) {
      const id = getRandomId();
      msg["id"] = id;
      console.log(`Sending: {type: ${msg["type"]}, id: ${id}}`);
      await waitUntilConditionReturnsTrueOrTimeout(() => {
        return this.commContainer !== void 0 && this._send !== void 0;
      }, MAX_WAIT_FOR_COMM_CREATION);
      if (this.commContainer === void 0 || this._send === void 0) {
        console.error(`Cannot send {type: ${msg["type"]}, id: ${id}}, as comm was never defined`);
        return;
      }
      this._send.call(this.commContainer.comm, msg);
      let loadingUpdated = false;
      const timeout = setTimeout(() => {
        this.setUIState((prevUIState) => {
          loadingUpdated = true;
          const newLoadingCalls = [...prevUIState.loading];
          newLoadingCalls.push([id, msg["step_id"], msg["type"]]);
          return __spreadProps(__spreadValues({}, prevUIState), {
            loading: newLoadingCalls
          });
        });
      }, 500);
      let response;
      if (!doNotWaitForReply) {
        response = await this.getResponseData(id, maxRetries);
      }
      clearTimeout(timeout);
      if (loadingUpdated) {
        this.setUIState((prevUIState) => {
          const newLoadingCalls = [...prevUIState.loading];
          const messageIndex = newLoadingCalls.findIndex((value) => {
            return value[0] === id;
          });
          newLoadingCalls.splice(messageIndex, 1);
          return __spreadProps(__spreadValues({}, prevUIState), {
            loading: newLoadingCalls
          });
        });
      }
      return response;
    }
    receiveResponse(rawResponse) {
      const response = rawResponse.content.data;
      this.unconsumedResponses.push(response);
      if (response["event"] == "response") {
        this.setSheetDataArray(getSheetDataArrayFromString(response.shared_variables.sheet_data_json));
        this.setAnalysisData(getAnalysisDataFromString(response.shared_variables.analysis_data_json));
        this.setUserProfile(getUserProfileFromString(response.shared_variables.user_profile_json));
      } else if (response["event"] == "edit_error") {
        if (response["data"] === void 0) {
          this.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: {
                type: "Error" /* Error */,
                error: response
              }
            });
          });
        }
      }
    }
    getResponseData(id, maxRetries = MAX_RETRIES) {
      return new Promise((resolve) => {
        let tries = 0;
        const interval = setInterval(() => {
          tries++;
          if (tries > maxRetries) {
            console.error(`No response on message: {id: ${id}}`);
            clearInterval(interval);
            return resolve(void 0);
          }
          const index = this.unconsumedResponses.findIndex((response) => {
            return response["id"] === id;
          });
          if (index !== -1) {
            clearInterval(interval);
            const response = this.unconsumedResponses[index];
            this.unconsumedResponses.splice(index, 1);
            return resolve(response["data"]);
          }
        }, RETRY_DELAY);
      });
    }
    async getPathContents(pathParts) {
      const pathDataString = await this.send({
        "event": "api_call",
        "type": "get_path_contents",
        "params": {
          "path_parts": pathParts
        }
      }, {});
      if (pathDataString == void 0) {
        return void 0;
      }
      try {
        return JSON.parse(pathDataString);
      } catch (e) {
        return void 0;
      }
    }
    async getPathJoined(pathParts) {
      const pathJoined = await this.send({
        "event": "api_call",
        "type": "get_path_join",
        "params": {
          "path_parts": pathParts
        }
      }, {});
      return pathJoined;
    }
    async getDataframeAsCSV(sheetIndex) {
      const sheetData = await this.send({
        "event": "api_call",
        "type": "get_dataframe_as_csv",
        "params": {
          "sheet_index": sheetIndex
        }
      }, { maxRetries: 250 });
      if (sheetData == void 0) {
        return "";
      }
      return sheetData;
    }
    async getDataframesAsExcel(sheetIndexes) {
      const excelFileString = await this.send({
        "event": "api_call",
        "type": "get_dataframe_as_excel",
        "params": {
          "sheet_indexes": sheetIndexes
        }
      }, { maxRetries: 1e3 });
      if (excelFileString == void 0) {
        return "";
      }
      return excelFileString;
    }
    async getColumnSummaryGraph(sheetIndex, column_id, height, width) {
      const graphString = await this.send({
        "event": "api_call",
        "type": "get_column_summary_graph",
        "params": {
          "sheet_index": sheetIndex,
          "column_id": column_id,
          "height": height,
          "width": width,
          "include_plotlyjs": window.Plotly === void 0
        }
      }, { maxRetries: 250 });
      if (graphString == void 0) {
        return void 0;
      }
      try {
        return JSON.parse(graphString);
      } catch (e) {
        return void 0;
      }
    }
    async getColumnDescribe(sheetIndex, columnID) {
      const describeString = await this.send({
        "event": "api_call",
        "type": "get_column_describe",
        "params": {
          "sheet_index": sheetIndex,
          "column_id": columnID
        }
      }, {});
      if (describeString == void 0) {
        return {};
      }
      try {
        return JSON.parse(describeString);
      } catch (e) {
        return {};
      }
    }
    async getParams(stepType, stepID, executionDataToMatch) {
      const params = await this.send({
        "event": "api_call",
        "type": "get_params",
        "params": {
          "step_type": stepType,
          "step_id_to_match": stepID || "",
          "execution_data_to_match": executionDataToMatch
        }
      }, {});
      if (params !== void 0 && params !== "") {
        return JSON.parse(params);
      }
      return void 0;
    }
    async getPivotParams(destinationSheetIndex) {
      return await this.getParams("pivot", void 0, {
        "destination_sheet_index": destinationSheetIndex
      });
    }
    async getExcelFileMetadata(filePath) {
      const excelFileMetadataString = await this.send({
        "event": "api_call",
        "type": "get_excel_file_metadata",
        "params": {
          "file_path": filePath
        }
      }, {});
      if (excelFileMetadataString !== void 0 && excelFileMetadataString !== "") {
        return JSON.parse(excelFileMetadataString);
      }
      return void 0;
    }
    async getCSVFilesMetadata(fileNames) {
      const csvFileMetadataString = await this.send({
        "event": "api_call",
        "type": "get_csv_files_metadata",
        "params": {
          "file_names": fileNames
        }
      }, {});
      if (csvFileMetadataString !== void 0 && csvFileMetadataString !== "") {
        return JSON.parse(csvFileMetadataString);
      }
      return void 0;
    }
    async getUniqueValueCounts(sheetIndex, columnID, searchString, sort) {
      const uniqueValueCountsString = await this.send({
        "event": "api_call",
        "type": "get_unique_value_counts",
        "params": {
          "sheet_index": sheetIndex,
          "column_id": columnID,
          "search_string": searchString,
          "sort": sort
        }
      }, {});
      if (uniqueValueCountsString !== void 0 && uniqueValueCountsString !== "") {
        const uniqueValueCountsObj = JSON.parse(uniqueValueCountsString);
        const uniqueValueCounts = [];
        for (let i = 0; i < uniqueValueCountsObj.uniqueValueRowDataArray.length; i++) {
          uniqueValueCounts.push({
            value: uniqueValueCountsObj.uniqueValueRowDataArray[i][0],
            percentOccurence: uniqueValueCountsObj.uniqueValueRowDataArray[i][1] * 100,
            countOccurence: uniqueValueCountsObj.uniqueValueRowDataArray[i][2],
            isNotFiltered: true
          });
        }
        return {
          uniqueValueCounts,
          isAllData: uniqueValueCountsObj.isAllData
        };
      }
      return void 0;
    }
    async getSplitTextToColumnsPreview(params) {
      const dfPreviewString = await this.send({
        "event": "api_call",
        "type": "get_split_text_to_columns_preview",
        "params": params
      }, {});
      if (dfPreviewString !== void 0 && dfPreviewString !== "") {
        return JSON.parse(dfPreviewString)["dfPreviewRowDataArray"];
      }
      return void 0;
    }
    async getDefinedDfNames() {
      const resultString = await this.send({
        "event": "api_call",
        "type": "get_defined_df_names",
        "params": {}
      }, {});
      if (resultString !== void 0 && resultString !== "") {
        return JSON.parse(resultString);
      }
      return void 0;
    }
    async getImportedFilesAndDataframesFromCurrentSteps() {
      const resultString = await this.send({
        "event": "api_call",
        "type": "get_imported_files_and_dataframes_from_current_steps",
        "params": {}
      }, {});
      if (resultString !== void 0 && resultString !== "") {
        return JSON.parse(resultString);
      }
      return void 0;
    }
    async getImportedFilesAndDataframesFromAnalysisName(analysisName) {
      const resultString = await this.send({
        "event": "api_call",
        "type": "get_imported_files_and_dataframes_from_analysis_name",
        "params": {
          "analysis_name": analysisName
        }
      }, {});
      if (resultString !== void 0 && resultString !== "") {
        return JSON.parse(resultString);
      }
      return void 0;
    }
    async getTestImports(updated_step_import_data_list) {
      const resultString = await this.send({
        "event": "api_call",
        "type": "get_test_imports",
        "params": {
          "updated_step_import_data_list": updated_step_import_data_list
        }
      }, {});
      if (resultString !== void 0 && resultString !== "") {
        return JSON.parse(resultString);
      }
      return void 0;
    }
    async getRenderCount() {
      return await this.send({
        "event": "api_call",
        "type": "get_render_count",
        "params": {}
      }, {});
    }
    async getCodeSnippets() {
      const resultString = await this.send({
        "event": "api_call",
        "type": "get_code_snippets",
        "params": {}
      }, {});
      if (resultString !== void 0 && resultString !== "") {
        return JSON.parse(resultString);
      }
      return void 0;
    }
    async getAvailableSnowflakeOptionsAndDefaults(table_loc_and_warehouse) {
      const resultString = await this.send({
        "event": "api_call",
        "type": "get_available_snowflake_options_and_defaults",
        "params": {
          "table_loc_and_warehouse": table_loc_and_warehouse
        }
      }, {});
      if (resultString !== void 0 && resultString !== "") {
        return JSON.parse(resultString);
      }
      return void 0;
    }
    async validateSnowflakeCredentials(params) {
      const resultString = await this.send({
        "event": "api_call",
        "type": "get_validate_snowflake_credentials",
        "params": params
      }, {});
      if (resultString !== void 0 && resultString !== "") {
        return JSON.parse(resultString);
      }
      return void 0;
    }
    async _edit(edit_event_type, params, stepID) {
      const result = await this.send({
        "event": "edit_event",
        "type": edit_event_type,
        "step_id": stepID,
        "params": params
      }, {});
      return result;
    }
    async editGraph(graphID, graphParams, height, width, stepID) {
      if (stepID === void 0 || stepID === "") {
        stepID = getRandomId();
      }
      const graphParamsBackend = convertFrontendtoBackendGraphParams(graphParams);
      await this.send({
        "event": "edit_event",
        "type": "graph_edit",
        "step_id": stepID,
        "params": {
          "graph_id": graphID,
          "graph_preprocessing": graphParamsBackend.graphPreprocessing,
          "graph_creation": graphParamsBackend.graphCreation,
          "graph_styling": graphParamsBackend.graphStyling,
          "graph_rendering": {
            "height": height,
            "width": width
          },
          "include_plotlyjs": window.Plotly === void 0
        }
      }, { maxRetries: 250 });
      return stepID;
    }
    async editGraphDelete(graphID) {
      await this.send({
        "event": "edit_event",
        "type": "graph_delete_edit",
        "step_id": getRandomId(),
        "params": {
          "graph_id": graphID
        }
      }, {});
    }
    async editGraphDuplicate(oldGraphID, newGraphID) {
      await this.send({
        "event": "edit_event",
        "type": "graph_duplicate_edit",
        "step_id": getRandomId(),
        "params": {
          "old_graph_id": oldGraphID,
          "new_graph_id": newGraphID
        }
      }, {});
    }
    async editGraphRename(graphID, newGraphTabName) {
      await this.send({
        "event": "edit_event",
        "type": "graph_rename_edit",
        "step_id": getRandomId(),
        "params": {
          "graph_id": graphID,
          "new_graph_tab_name": newGraphTabName
        }
      }, {});
    }
    async editAddColumn(sheetIndex, columnHeader, columnHeaderIndex, stepID) {
      if (stepID === void 0 || stepID == "") {
        stepID = getRandomId();
      }
      await this.send({
        "event": "edit_event",
        "type": "add_column_edit",
        "step_id": stepID,
        "params": {
          "sheet_index": sheetIndex,
          "column_header": columnHeader,
          "column_header_index": columnHeaderIndex
        }
      }, {});
      return stepID;
    }
    async editDeleteColumn(sheetIndex, columnIDs) {
      const stepID = getRandomId();
      columnIDs = columnIDs.filter((columnID) => columnID !== void 0);
      await this.send({
        "event": "edit_event",
        "type": "delete_column_edit",
        "step_id": stepID,
        "params": {
          "sheet_index": sheetIndex,
          "column_ids": columnIDs
        }
      }, {});
    }
    async editDeleteRow(sheetIndex, labels) {
      const stepID = getRandomId();
      await this.send({
        "event": "edit_event",
        "type": "delete_row_edit",
        "step_id": stepID,
        "params": {
          "sheet_index": sheetIndex,
          "labels": labels
        }
      }, {});
    }
    async editTranspose(sheet_index) {
      const stepID = getRandomId();
      await this.send({
        "event": "edit_event",
        "type": "transpose_edit",
        "step_id": stepID,
        "params": {
          sheet_index
        }
      }, {});
    }
    async editOneHotEncoding(sheet_index, column_id) {
      const stepID = getRandomId();
      await this.send({
        "event": "edit_event",
        "type": "one_hot_encoding_edit",
        "step_id": stepID,
        "params": {
          sheet_index,
          column_id
        }
      }, {});
    }
    async editResetIndex(sheet_index, drop) {
      const stepID = getRandomId();
      await this.send({
        "event": "edit_event",
        "type": "reset_index_edit",
        "step_id": stepID,
        "params": {
          sheet_index,
          drop
        }
      }, {});
    }
    async editPromoteRowToHeader(sheetIndex, index) {
      const stepID = getRandomId();
      await this.send({
        "event": "edit_event",
        "type": "promote_row_to_header_edit",
        "step_id": stepID,
        "params": {
          "sheet_index": sheetIndex,
          "index": index
        }
      }, {});
    }
    async editReorderColumn(sheetIndex, columnID, newIndex) {
      const stepID = getRandomId();
      await this.send({
        "event": "edit_event",
        "type": "reorder_column_edit",
        "step_id": stepID,
        "params": {
          "sheet_index": sheetIndex,
          "column_id": columnID,
          "new_column_index": newIndex
        }
      }, {});
    }
    async editDataframeRename(sheetIndex, newDataframeName, stepID) {
      if (stepID === void 0 || stepID === "") {
        stepID = getRandomId();
      }
      await this.send({
        "event": "edit_event",
        "type": "dataframe_rename_edit",
        "step_id": stepID,
        "params": {
          "sheet_index": sheetIndex,
          "new_dataframe_name": newDataframeName
        }
      }, {});
      return stepID;
    }
    async editFilter(sheetIndex, columnID, filters, operator, filterLocation, stepID) {
      if (stepID === void 0 || stepID === "") {
        stepID = getRandomId();
      }
      await this.send({
        event: "edit_event",
        type: "filter_column_edit",
        "step_id": stepID,
        "params": {
          sheet_index: sheetIndex,
          column_id: columnID,
          operator,
          filters,
          filter_location: filterLocation
        }
      }, {});
      return stepID;
    }
    async editSort(sheetIndex, columnID, sortDirection, stepID) {
      if (stepID === void 0 || stepID === "") {
        stepID = getRandomId();
      }
      await this.send({
        event: "edit_event",
        type: "sort_edit",
        "step_id": stepID,
        "params": {
          sheet_index: sheetIndex,
          column_id: columnID,
          sort_direction: sortDirection
        }
      }, {});
      return stepID;
    }
    async editRenameColumn(sheetIndex, columnID, newColumnHeader, level, stepID) {
      if (stepID === void 0 || stepID === "") {
        stepID = getRandomId();
      }
      await this.send({
        event: "edit_event",
        type: "rename_column_edit",
        "step_id": stepID,
        "params": {
          sheet_index: sheetIndex,
          column_id: columnID,
          new_column_header: newColumnHeader,
          level
        }
      }, {});
      return stepID;
    }
    async editDataframeDuplicate(sheetIndex) {
      const stepID = getRandomId();
      await this.send({
        "event": "edit_event",
        "type": "dataframe_duplicate_edit",
        "step_id": stepID,
        "params": {
          "sheet_index": sheetIndex
        }
      }, {});
    }
    async editDataframeDelete(sheetIndex) {
      const stepID = getRandomId();
      await this.send({
        "event": "edit_event",
        "type": "dataframe_delete_edit",
        "step_id": stepID,
        "params": {
          "sheet_index": sheetIndex
        }
      }, {});
    }
    async editSetDataframeFormat(sheetIndex, dfFormat) {
      const stepID = getRandomId();
      return await this.send({
        "event": "edit_event",
        "type": "set_dataframe_format_edit",
        "step_id": stepID,
        "params": {
          "sheet_index": sheetIndex,
          "df_format": dfFormat
        }
      }, {});
    }
    async editSetColumnFormula(sheetIndex, columnID, formula_label, newFormula, index_labels_formula_is_applied_to, cell_editor_location) {
      const stepID = getRandomId();
      return await this.send({
        "event": "edit_event",
        "type": "set_column_formula_edit",
        "step_id": stepID,
        "params": {
          "sheet_index": sheetIndex,
          "column_id": columnID,
          "formula_label": formula_label,
          "new_formula": newFormula,
          "index_labels_formula_is_applied_to": index_labels_formula_is_applied_to,
          "cell_editor_location": cell_editor_location
        }
      }, {});
    }
    async editSetCellValue(sheetIndex, columnID, dataframeRowIndex, newValue, cell_editor_location) {
      const stepID = getRandomId();
      return await this.send({
        "event": "edit_event",
        "type": "set_cell_value_edit",
        "step_id": stepID,
        "params": {
          "sheet_index": sheetIndex,
          "column_id": columnID,
          "row_index": dataframeRowIndex,
          "new_value": newValue,
          "cell_editor_location": cell_editor_location
        }
      }, {});
    }
    async editChangeColumnDtype(sheetIndex, columnIDs, newDtype, stepID) {
      if (stepID === void 0 || stepID == "") {
        stepID = getRandomId();
      }
      await this.send({
        "event": "edit_event",
        "type": "change_column_dtype_edit",
        "step_id": stepID,
        "params": {
          "sheet_index": sheetIndex,
          "column_ids": columnIDs,
          "new_dtype": newDtype
        }
      }, {});
      return stepID;
    }
    async editSimpleImport(fileNames) {
      const stepID = getRandomId();
      const result = await this.send({
        "event": "edit_event",
        "type": "simple_import_edit",
        "step_id": stepID,
        "params": {
          "file_names": fileNames
        }
      }, {});
      return result;
    }
    async editExcelImport(fileName, sheetNames, hasHeaders, skiprows, stepID) {
      if (stepID === void 0 || stepID == "") {
        stepID = getRandomId();
      }
      await this.send({
        "event": "edit_event",
        "type": "excel_import_edit",
        "step_id": stepID,
        "params": {
          "file_name": fileName,
          "sheet_names": sheetNames,
          "has_headers": hasHeaders,
          "skiprows": skiprows
        }
      }, { maxRetries: 1e3 });
      return stepID;
    }
    async updateUndo() {
      await this.send({
        "event": "update_event",
        "type": "undo",
        "params": {}
      }, {});
    }
    async updateGoPro() {
      await this.send({
        "event": "update_event",
        "type": "go_pro",
        "params": {}
      }, {});
    }
    async updateRedo() {
      await this.send({
        "event": "update_event",
        "type": "redo",
        "params": {}
      }, {});
    }
    async updateClear() {
      await this.send({
        "event": "update_event",
        "type": "clear",
        "params": {}
      }, {});
    }
    async updateArgs(args) {
      await this.send({
        "event": "update_event",
        "type": "args_update",
        "params": {
          "args": args
        }
      }, {});
    }
    async updateRenderCount() {
      await this.send({
        "event": "update_event",
        "type": "render_count_update",
        "params": {
          "number_rendered_sheets": document.querySelectorAll(".mito-container").length,
          "jupyterlab_theme": document.body.getAttribute("data-jp-theme-name") || "undefined"
        }
      }, {});
    }
    async updateReplayAnalysis(analysisName, stepImportDataListToOverwrite) {
      const result = await this.send({
        "event": "update_event",
        "type": "replay_analysis_update",
        "params": {
          "analysis_name": analysisName,
          "step_import_data_list_to_overwrite": stepImportDataListToOverwrite === void 0 ? [] : stepImportDataListToOverwrite
        }
      }, { maxRetries: 500 });
      return result;
    }
    async updateSignUp(userEmail) {
      await this.send({
        "event": "update_event",
        "type": "set_user_field_update",
        "params": {
          "field": "user_email" /* UJ_USER_EMAIL */,
          "value": userEmail
        }
      }, {});
    }
    async updateExistingImports(updatedStepImportDataList) {
      return await this.send({
        "event": "update_event",
        "type": "update_existing_import_update",
        "params": {
          "updated_step_import_data_list": updatedStepImportDataList
        }
      }, {});
    }
    async updateManuallyMarkUpgraded() {
      const tenDaysAgo = new Date().getDate() - 10;
      const tenDaysAgoDate = new Date();
      tenDaysAgoDate.setDate(tenDaysAgo);
      await this.send({
        "event": "update_event",
        "type": "set_user_field_update",
        "params": {
          "field": "mitosheet_last_upgraded_date" /* UJ_MITOSHEET_LAST_UPGRADED_DATE */,
          "value": tenDaysAgoDate.toISOString().split("T")[0]
        }
      }, {});
    }
    async updateCheckoutStepByIndex(stepIndex) {
      await this.send({
        "event": "update_event",
        "type": "checkout_step_by_idx_update",
        "params": {
          "step_idx": stepIndex
        }
      }, {});
    }
    async updateCloseTour(tourNames) {
      await this.send({
        "event": "update_event",
        "type": "append_user_field_update",
        "params": {
          "field": "received_tours" /* UJ_RECEIVED_TOURS */,
          "value": tourNames
        }
      }, {});
    }
    async updateFeedback(feedbackID, numUsages, questionsAndAnswers) {
      const message = {
        "event": "update_event",
        "type": "update_feedback_v2_obj_update",
        "params": {
          "feedback_id": feedbackID,
          "num_usages": numUsages,
          "questions_and_answers": questionsAndAnswers
        }
      };
      questionsAndAnswers.forEach((questionAndAnswer) => {
        message[questionAndAnswer["question"]] = questionAndAnswer["answer"];
      });
      await this.send(message, {});
    }
    async updateChecklist(checklistID, completedItems, clearOtherItems) {
      await this.send({
        "event": "update_event",
        "type": "checklist_update",
        "params": {
          "checklist_id": checklistID,
          "completed_items": completedItems,
          "clear_other_items": clearOtherItems
        }
      }, {});
    }
    async log(logEventType, params) {
      const message = {};
      const defaultParams = {
        "user_agent": window.navigator.userAgent
      };
      if (params !== void 0) {
        message["params"] = Object.assign(defaultParams, params);
      } else {
        message["params"] = defaultParams;
      }
      message["event"] = "log_event";
      message["type"] = logEventType;
      await this.send(message, { doNotWaitForReply: true });
    }
  };

  // src/utils/errors.tsx
  function isMitoError(possibleError) {
    return possibleError !== null && possibleError !== void 0 && possibleError.to_fix !== void 0;
  }

  // src/hooks/useEffectOnUpdateEvent.tsx
  var import_react25 = __toESM(require_react());
  var useEffectOnUpdateEvent = (effect, analysisData2) => {
    const [firstRender, setFirstRender] = (0, import_react25.useState)(true);
    (0, import_react25.useEffect)(() => {
      if (firstRender) {
        setFirstRender(false);
        return;
      }
      effect();
    }, [analysisData2.updateEventCount]);
  };

  // src/hooks/useLiveUpdatingParams.tsx
  function useLiveUpdatingParams(defaultParams, stepType, mitoAPI, analysisData2, debounceDelay, frontendToBackendConverters, options, sheetDataArray2) {
    const [params, _setParams] = (0, import_react26.useState)(defaultParams);
    const [updateNumber, setUpdateNumber] = (0, import_react26.useState)(0);
    const [stepID, setStepID] = (0, import_react26.useState)(void 0);
    const [error, setError] = (0, import_react26.useState)(void 0);
    const [loading, setLoading] = (0, import_react26.useState)(false);
    const converters = frontendToBackendConverters || {
      getBackendFromFrontend: (p) => {
        return p;
      },
      getFrontendFromBackend: (p) => {
        return p;
      }
    };
    useDebouncedEffect(() => {
      void onChange();
    }, [updateNumber], debounceDelay);
    useEffectOnUpdateEvent(() => {
      void refreshParams();
    }, analysisData2);
    const editEvent = stepType + "_edit";
    const setParams = (0, import_react26.useCallback)(
      (args) => {
        _setParams(args);
        setUpdateNumber((old) => old + 1);
      },
      []
    );
    const onChange = async () => {
      if (params === void 0) {
        return;
      }
      if ((options == null ? void 0 : options.doNotSendDefaultParams) === true && updateNumber === 0) {
        return;
      }
      const finalParams = converters.getBackendFromFrontend(params, sheetDataArray2);
      setLoading(true);
      const stepIDToSend = stepID || getRandomId();
      const possibleError = await mitoAPI._edit(editEvent, finalParams, stepIDToSend);
      setLoading(false);
      if (isMitoError(possibleError)) {
        setError(possibleError.to_fix);
      } else {
        setStepID(stepIDToSend);
        setError(void 0);
      }
    };
    const refreshParams = async () => {
      if (stepID === void 0) {
        _setParams(defaultParams);
        return;
      }
      const newBackendParams = await mitoAPI.getParams(stepType, stepID, {});
      if (newBackendParams !== void 0) {
        _setParams(converters.getFrontendFromBackend(newBackendParams, sheetDataArray2));
      } else {
        _setParams(defaultParams);
      }
      setError(void 0);
    };
    return {
      params,
      setParams,
      error,
      loading,
      startNewStep: () => {
        setStepID(void 0);
      }
    };
  }
  var useLiveUpdatingParams_default = useLiveUpdatingParams;

  // src/components/elements/TextButton.tsx
  var import_react27 = __toESM(require_react());
  var TextButton = (props) => {
    const disabled = props.disabled === true;
    const width = props.width || "block";
    const className = props.className || "";
    const disabledClass = disabled ? "text-button-disabled" : "";
    const widthClass = `element-width-${width}`;
    const variantClass = `text-button-variant-${props.variant}`;
    const disabledTooltip = props.disabled && props.disabledTooltip !== void 0 ? props.disabledTooltip : void 0;
    const tooltip = disabledTooltip !== void 0 ? disabledTooltip : props.tooltip;
    if (props.href !== void 0) {
      return /* @__PURE__ */ import_react27.default.createElement(
        "a",
        {
          className: classNames("text-button", widthClass, variantClass, disabledClass, className),
          href: disabled ? void 0 : props.href,
          download: disabled ? void 0 : props.download,
          onClick: disabled ? () => {
            return;
          } : props.onClick,
          target: props.target,
          title: tooltip
        },
        /* @__PURE__ */ import_react27.default.createElement(
          "span",
          {
            className: classNames({ "text-color-white-important": props.variant === "dark" }, "text-overflow-wrap")
          },
          props.children
        )
      );
    } else {
      return /* @__PURE__ */ import_react27.default.createElement(
        "button",
        {
          className: classNames("text-button", widthClass, variantClass, disabledClass),
          onClick: props.onClick,
          type: props.type,
          disabled: props.disabled,
          autoFocus: props.autoFocus,
          title: tooltip
        },
        props.children
      );
    }
  };
  var TextButton_default = TextButton;

  // src/components/taskpanes/ControlPanel/FilterAndSortTab/filter/filterUtils.tsx
  var import_react29 = __toESM(require_react());

  // src/components/elements/DropdownSectionSeperator.tsx
  var import_react28 = __toESM(require_react());
  var DropdownSectionSeperator = (props) => {
    props.isDropdownSectionSeperator;
    return /* @__PURE__ */ import_react28.default.createElement("div", { style: { width: "100%", borderTop: "1px solid #dadce0", paddingBottom: "3px", marginTop: "3px" } });
  };
  var DropdownSectionSeperator_default = DropdownSectionSeperator;

  // src/components/taskpanes/ControlPanel/FilterAndSortTab/filter/filterConditions.tsx
  var BOOLEAN_SELECT_OPTIONS = {
    ["boolean_is_true"]: {
      long_name: "is true",
      short_name: "is true"
    },
    ["boolean_is_false"]: {
      long_name: "is false",
      short_name: "is false"
    }
  };
  var NUMBER_SELECT_OPTIONS = {
    ["number_exactly"]: {
      long_name: "=",
      short_name: "="
    },
    ["number_not_exactly"]: {
      long_name: "\u2260",
      short_name: "\u2260"
    },
    ["greater"]: {
      long_name: ">",
      short_name: ">"
    },
    ["greater_than_or_equal"]: {
      long_name: "\u2265",
      short_name: "\u2265"
    },
    ["less"]: {
      long_name: "<",
      short_name: "<"
    },
    ["less_than_or_equal"]: {
      long_name: "\u2264",
      short_name: "\u2264"
    },
    ["number_lowest"]: {
      long_name: "lowest N values",
      short_name: "lowest N"
    },
    ["number_highest"]: {
      long_name: "highest N values",
      short_name: "highest N"
    }
  };
  var STRING_SELECT_OPTIONS = {
    ["contains"]: {
      long_name: "string contains",
      short_name: "contains"
    },
    ["string_does_not_contain"]: {
      long_name: "string does not contain",
      short_name: "does not contain"
    },
    ["string_exactly"]: {
      long_name: "string is exactly",
      short_name: "is exactly"
    },
    ["string_not_exactly"]: {
      long_name: "string is not exactly",
      short_name: "is not exactly"
    },
    ["string_starts_with"]: {
      long_name: "string starts with",
      short_name: "starts with"
    },
    ["string_ends_with"]: {
      long_name: "string ends with",
      short_name: "ends with"
    }
  };
  var DATETIME_SELECT_OPTIONS = {
    ["datetime_exactly"]: {
      long_name: "date is exactly",
      short_name: "="
    },
    ["datetime_not_exactly"]: {
      long_name: "date is not exactly",
      short_name: "!="
    },
    ["datetime_greater"]: {
      long_name: "date is after",
      short_name: ">"
    },
    ["datetime_greater_than_or_equal"]: {
      long_name: "date is exactly or after",
      short_name: "\u2265"
    },
    ["datetime_less"]: {
      long_name: "date is before",
      short_name: "<"
    },
    ["datetime_less_than_or_equal"]: {
      long_name: "date is exactly or before",
      short_name: "\u2264"
    }
  };
  var SHARED_SELECT_OPTIONS = {
    ["empty"]: {
      long_name: "is empty",
      short_name: "is empty"
    },
    ["not_empty"]: {
      long_name: "is not empty",
      short_name: "is not empty"
    },
    ["most_frequent"]: {
      long_name: "most frequent N values",
      short_name: "most frequent N"
    },
    ["least_frequent"]: {
      long_name: "least frequent N values",
      short_name: "least frequent N"
    }
  };
  var ALL_SELECT_OPTIONS = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, BOOLEAN_SELECT_OPTIONS), NUMBER_SELECT_OPTIONS), STRING_SELECT_OPTIONS), DATETIME_SELECT_OPTIONS), SHARED_SELECT_OPTIONS);
  var CONDITIONS_WITH_NO_INPUT = [
    "boolean_is_true",
    "boolean_is_false",
    "empty",
    "not_empty"
  ];

  // src/components/taskpanes/ControlPanel/FilterAndSortTab/filter/filterTypes.tsx
  function isFilterGroup(filter) {
    return filter.filters !== void 0;
  }

  // src/components/taskpanes/ControlPanel/FilterAndSortTab/filter/filterUtils.tsx
  function getFilterDisabledMessage(columnDtype) {
    if (isTimedeltaDtype(columnDtype)) {
      return "Sorry, Mito does not support filtering on timedeltas columns currently. Try changing the column dtype to a string and filtering on that instead.";
    }
    return void 0;
  }
  function getEmptyFilterData(columnDtype) {
    if (isBoolDtype(columnDtype)) {
      return {
        condition: "boolean_is_true",
        value: ""
      };
    } else if (isStringDtype(columnDtype)) {
      return {
        condition: "contains",
        value: ""
      };
    } else if (isNumberDtype(columnDtype)) {
      return {
        condition: "greater",
        value: ""
      };
    } else if (isDatetimeDtype(columnDtype)) {
      return {
        condition: "datetime_exactly",
        value: ""
      };
    } else {
      return {
        condition: "not_empty",
        value: ""
      };
    }
  }
  function getExclusiveFilterData(columnDtype, value) {
    const isNaN2 = isValueNone(value);
    if (isBoolDtype(columnDtype)) {
      return {
        condition: isNaN2 ? "not_empty" : value ? "boolean_is_false" : "boolean_is_true",
        value: ""
      };
    } else if (isStringDtype(columnDtype)) {
      return {
        condition: isNaN2 ? "not_empty" : "string_not_exactly",
        value
      };
    } else if (isNumberDtype(columnDtype)) {
      return {
        condition: isNaN2 ? "not_empty" : "number_not_exactly",
        value
      };
    } else if (isDatetimeDtype(columnDtype)) {
      return {
        condition: isNaN2 ? "not_empty" : "datetime_not_exactly",
        value: value.split(" ")[0]
      };
    } else {
      return {
        condition: "contains",
        value: ""
      };
    }
  }
  var checkFilterShouldHaveNumberValue = (filter) => {
    return (Object.keys(NUMBER_SELECT_OPTIONS).includes(filter.condition) || filter.condition === "most_frequent" || filter.condition === "least_frequent") && typeof filter.value === "string";
  };
  var isValidFilter = (filter, columnDtype) => {
    if (CONDITIONS_WITH_NO_INPUT.includes(filter.condition)) {
      return true;
    }
    if (isNumberDtype(columnDtype)) {
      return typeof filter.value !== "string" && !isNaN(filter.value);
    }
    if (isStringDtype(columnDtype) || isDatetimeDtype(columnDtype)) {
      return filter.value !== "";
    }
    return true;
  };
  var parseFilter = (filter) => {
    if (checkFilterShouldHaveNumberValue(filter)) {
      return {
        condition: filter.condition,
        value: parseFloat(filter.value)
      };
    }
    return filter;
  };
  var getFiltersToApply = (filters, columnDtype) => {
    const parsedFilters = filters.map((filterOrGroup) => {
      if (isFilterGroup(filterOrGroup)) {
        return {
          filters: filterOrGroup.filters.map((filter) => {
            return parseFilter(filter);
          }),
          operator: filterOrGroup.operator
        };
      } else {
        return parseFilter(filterOrGroup);
      }
    });
    const filtersToApply = parsedFilters.map((filterOrGroup) => {
      if (isFilterGroup(filterOrGroup)) {
        return {
          filters: filterOrGroup.filters.filter((filter) => {
            return isValidFilter(filter, columnDtype);
          }),
          operator: filterOrGroup.operator
        };
      } else {
        return filterOrGroup;
      }
    }).filter((filterOrGroup) => {
      if (isFilterGroup(filterOrGroup)) {
        return filterOrGroup.filters.length > 0;
      }
      return isValidFilter(filterOrGroup, columnDtype);
    });
    return filtersToApply;
  };
  var getAllDoesNotContainsFilterValues = (filters, columnDtype) => {
    const filteredOutValues = [];
    filters.forEach((filterOrGroup) => {
      if (isFilterGroup(filterOrGroup)) {
        return;
      } else if (isBoolDtype(columnDtype)) {
        if (filterOrGroup.condition === "boolean_is_false") {
          filteredOutValues.push(true);
        } else if (filterOrGroup.condition === "boolean_is_true") {
          filteredOutValues.push(false);
        }
      } else {
        if (filterOrGroup.condition === getNotExactlyFilterCondition(columnDtype)) {
          filteredOutValues.push(filterOrGroup.value);
        } else if (filterOrGroup.condition === "not_empty") {
          filteredOutValues.push("NaN");
        }
      }
    });
    return filteredOutValues;
  };
  var getNotExactlyFilterCondition = (columnDtype) => {
    if (isNumberDtype(columnDtype)) {
      return "number_not_exactly";
    } else if (isStringDtype(columnDtype)) {
      return "string_not_exactly";
    } else if (isDatetimeDtype(columnDtype)) {
      return "datetime_not_exactly";
    } else {
      return "";
    }
  };
  var areFiltersEqual = (filterOne, filterTwo) => {
    const valueOne = isValueNone(filterOne.value) || filterOne.value;
    const valueTwo = isValueNone(filterOne.value) || filterTwo.value;
    return valueOne == valueTwo && filterOne.condition === filterTwo.condition;
  };
  var isValueNone = (value) => {
    return value === "NaN" || value === "nan" || value === "NaT" || value === "nat" || value === null || value === void 0;
  };
  var addToFilterOptions = (prevFilterOptions, newOptions, name) => {
    const newFilterOptions = [...prevFilterOptions];
    Object.entries(newOptions).forEach(([filterCondition, displayFilterCondition]) => {
      newFilterOptions.push(
        /* @__PURE__ */ import_react29.default.createElement(
          DropdownItem_default,
          {
            key: filterCondition,
            id: filterCondition,
            title: displayFilterCondition[name]
          }
        )
      );
    });
    return newFilterOptions;
  };
  var getFilterOptions = (columnDtype, nameLength) => {
    let filterOptions = [];
    if (!columnDtype || isNumberDtype(columnDtype)) {
      filterOptions = addToFilterOptions(filterOptions, NUMBER_SELECT_OPTIONS, nameLength);
      filterOptions.push(/* @__PURE__ */ import_react29.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }));
    }
    if (!columnDtype || isStringDtype(columnDtype)) {
      filterOptions = addToFilterOptions(filterOptions, STRING_SELECT_OPTIONS, nameLength);
      filterOptions.push(/* @__PURE__ */ import_react29.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }));
    }
    if (!columnDtype || isBoolDtype(columnDtype)) {
      filterOptions = addToFilterOptions(filterOptions, BOOLEAN_SELECT_OPTIONS, nameLength);
      filterOptions.push(/* @__PURE__ */ import_react29.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }));
    }
    if (!columnDtype || isDatetimeDtype(columnDtype)) {
      filterOptions = addToFilterOptions(filterOptions, DATETIME_SELECT_OPTIONS, nameLength);
      filterOptions.push(/* @__PURE__ */ import_react29.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }));
    }
    filterOptions = addToFilterOptions(filterOptions, SHARED_SELECT_OPTIONS, nameLength);
    return filterOptions;
  };

  // src/components/taskpanes/DefaultTaskpane/DefaultEmptyTaskpane.tsx
  var import_react35 = __toESM(require_react());

  // src/components/taskpanes/taskpanes.tsx
  var EDITING_TASKPANES = [
    "pivot" /* PIVOT */,
    "merge" /* MERGE */,
    "concat" /* CONCAT */,
    "drop_duplicates" /* DROP_DUPLICATES */,
    "import files" /* IMPORT_FILES */,
    "download" /* DOWNLOAD */,
    "split_text_to_columns" /* SPLIT_TEXT_TO_COLUMNS */,
    "fill_na" /* FILL_NA */,
    "melt" /* MELT */,
    "set_dataframe_format" /* SET_DATAFRAME_FORMAT */,
    "SnowflakeImport" /* SNOWFLAKEIMPORT */,
    "Excel Range Import" /* EXCEL_RANGE_IMPORT */,
    "Export To File" /* EXPORT_TO_FILE */
  ];
  var ALLOW_UNDO_REDO_EDITING_TASKPANES = [
    "pivot" /* PIVOT */,
    "merge" /* MERGE */,
    "concat" /* CONCAT */,
    "drop_duplicates" /* DROP_DUPLICATES */,
    "import files" /* IMPORT_FILES */,
    "split_text_to_columns" /* SPLIT_TEXT_TO_COLUMNS */,
    "fill_na" /* FILL_NA */,
    "melt" /* MELT */,
    "set_dataframe_format" /* SET_DATAFRAME_FORMAT */,
    "ConditionalFormatting" /* CONDITIONALFORMATTING */,
    "UpdateImports" /* UPDATEIMPORTS */,
    "SnowflakeImport" /* SNOWFLAKEIMPORT */,
    "Excel Range Import" /* EXCEL_RANGE_IMPORT */
  ];

  // src/components/taskpanes/DefaultTaskpane/DefaultTaskpane.tsx
  var import_react30 = __toESM(require_react());
  var DefaultTaskpane = (props) => {
    return /* @__PURE__ */ import_react30.default.createElement("div", { className: "default-taskpane-div" }, props.children);
  };
  var DefaultTaskpane_default = DefaultTaskpane;

  // src/components/taskpanes/DefaultTaskpane/DefaultTaskpaneBody.tsx
  var import_react32 = __toESM(require_react());

  // src/components/elements/MitoProUpgradePrompt.tsx
  var import_react31 = __toESM(require_react());
  var MitoProUpgradePrompt = (props) => {
    return /* @__PURE__ */ import_react31.default.createElement("div", null, /* @__PURE__ */ import_react31.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react31.default.createElement("p", { className: "text-body-1" }, props.message || "This is a Mito Pro feature. To access all Mito Pro functionality, please upgrade.")), /* @__PURE__ */ import_react31.default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ import_react31.default.createElement(TextButton_default, { href: "https://trymito.io/plans", target: "_blank", variant: "dark", width: "large" }, "Upgrade to Mito Pro")));
  };
  var MitoProUpgradePrompt_default = MitoProUpgradePrompt;

  // src/components/taskpanes/DefaultTaskpane/DefaultTaskpaneBody.tsx
  var DefaultTaskpaneBody = (props) => {
    var _a;
    const promptUpgrade = !((_a = props.userProfile) == null ? void 0 : _a.isPro) && props.requiresPro;
    return /* @__PURE__ */ import_react32.default.createElement(import_react32.default.Fragment, null, promptUpgrade && /* @__PURE__ */ import_react32.default.createElement(
      MitoProUpgradePrompt_default,
      {
        message: props.requiresProMessage
      }
    ), /* @__PURE__ */ import_react32.default.createElement("div", { className: classNames("default-taskpane-body-div", { "default-taskpane-body-div-no-scroll": props.noScroll, "default-taskpane-body-disabled": promptUpgrade }) }, props.children));
  };
  var DefaultTaskpaneBody_default = DefaultTaskpaneBody;

  // src/components/taskpanes/DefaultTaskpane/DefaultTaskpaneHeader.tsx
  var import_react34 = __toESM(require_react());

  // src/components/icons/BackArrowIcon.tsx
  var import_react33 = __toESM(require_react());
  var BackArrowIcon = (props) => {
    return /* @__PURE__ */ import_react33.default.createElement("svg", { width: props.width || "24", height: "16", viewBox: "0 0 24 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react33.default.createElement("path", { d: "M0.292892 7.29289C-0.0976315 7.68342 -0.0976315 8.31658 0.292892 8.70711L6.65685 15.0711C7.04738 15.4616 7.68054 15.4616 8.07107 15.0711C8.46159 14.6805 8.46159 14.0474 8.07107 13.6569L2.41421 8L8.07107 2.34315C8.46159 1.95262 8.46159 1.31946 8.07107 0.928932C7.68054 0.538408 7.04738 0.538408 6.65685 0.928932L0.292892 7.29289ZM24 7L1 7V9L24 9V7Z", fill: "#494650" }));
  };
  var BackArrowIcon_default = BackArrowIcon;

  // src/components/taskpanes/DefaultTaskpane/DefaultTaskpaneHeader.tsx
  var DefaultTaskpane2 = (props) => {
    return /* @__PURE__ */ import_react34.default.createElement("div", { className: "default-taskpane-header-div" }, /* @__PURE__ */ import_react34.default.createElement(Row_default, { suppressTopBottomMargin: true }, /* @__PURE__ */ import_react34.default.createElement(Col_default, { span: 23 }, typeof props.header !== "string" && props.header, typeof props.header === "string" && /* @__PURE__ */ import_react34.default.createElement("div", { className: "default-taskpane-header-and-back-button" }, props.backCallback !== void 0 && /* @__PURE__ */ import_react34.default.createElement("div", { onClick: props.backCallback, className: "mt-5px mr-10px" }, /* @__PURE__ */ import_react34.default.createElement(BackArrowIcon_default, null)), /* @__PURE__ */ import_react34.default.createElement("p", { className: "text-header-2 text-overflow-hide" }, props.header))), /* @__PURE__ */ import_react34.default.createElement(Col_default, { span: 1 }, !props.notCloseable && /* @__PURE__ */ import_react34.default.createElement(
      "div",
      {
        className: "default-taskpane-header-exit-button-div",
        onClick: () => {
          if (props.callbackOnClose) {
            props.callbackOnClose();
          }
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "none" /* NONE */ }
            });
          });
        }
      },
      /* @__PURE__ */ import_react34.default.createElement(XIcon_default, null)
    ))));
  };
  var DefaultTaskpaneHeader_default = DefaultTaskpane2;

  // src/components/taskpanes/DefaultTaskpane/DefaultEmptyTaskpane.tsx
  var DefaultEmptyTaskpane = (props) => {
    const openImportTaskpane = () => {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: { type: "import files" /* IMPORT_FILES */ }
        });
      });
    };
    return /* @__PURE__ */ import_react35.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react35.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: props.header !== void 0 ? props.header : "Import data first",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react35.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react35.default.createElement(
      "p",
      {
        className: classNames("text-body-1", "text-overflow-wrap", { "text-color-error": props.errorMessage }),
        style: { whiteSpace: "pre-wrap" }
      },
      props.message ? props.message : "Before performing that action, you need to import data into Mito.",
      props.suppressImportLink !== true && /* @__PURE__ */ import_react35.default.createElement(import_react35.default.Fragment, null, " ", /* @__PURE__ */ import_react35.default.createElement("span", { className: "text-body-1-link", onClick: openImportTaskpane }, "Click here to import data."))
    )));
  };
  var DefaultEmptyTaskpane_default = DefaultEmptyTaskpane;

  // src/pro/taskpanes/SetDataframeFormat/SetDataframeFormatTaskpane.tsx
  var import_react76 = __toESM(require_react());

  // src/components/endo/ColumnHeader.tsx
  var import_react66 = __toESM(require_react());

  // src/components/icons/FilterIcons.tsx
  var import_react36 = __toESM(require_react());
  var FilterIcon = (props) => {
    if (props.nonEmpty) {
      return /* @__PURE__ */ import_react36.default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react36.default.createElement("path", { d: "M12.681 1H1.31902C1.0608 1 0.90821 1.31983 1.0608 1.55011L5.72061 8.58635V13L8.27939 11.8614V8.6887L12.9392 1.55011C13.0918 1.30704 12.9392 1 12.681 1Z", fill: "#9D6CFF", stroke: "#9D6CFF", strokeMiterlimit: "10", strokeLinecap: "round" }));
    }
    if (props.purpleOrDark === "dark") {
      return /* @__PURE__ */ import_react36.default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react36.default.createElement("path", { d: "M12.681 1H1.31902C1.0608 1 0.90821 1.31983 1.0608 1.55011L5.72061 8.58635V13L8.27939 11.8614V8.6887L12.9392 1.55011C13.0918 1.30704 12.9392 1 12.681 1Z", stroke: "#343434", strokeWidth: "0.9909", strokeMiterlimit: "10", strokeLinecap: "round" }));
    } else {
      return /* @__PURE__ */ import_react36.default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react36.default.createElement("path", { d: "M12.681 1H1.31902C1.0608 1 0.90821 1.31983 1.0608 1.55011L5.72061 8.58635V13L8.27939 11.8614V8.6887L12.9392 1.55011C13.0918 1.30704 12.9392 1 12.681 1Z", stroke: "var(--mito-purple)", strokeWidth: "0.9909", strokeMiterlimit: "10", strokeLinecap: "round" }));
    }
  };

  // src/components/endo/EndoGrid.tsx
  var import_react49 = __toESM(require_react());

  // src/components/endo/FormulaBar.tsx
  var import_react40 = __toESM(require_react());

  // src/data/function_documentation.tsx
  var functionDocumentationObjects = [{ "function": "ABS", "description": "Returns the absolute value of the passed number or series.", "search_terms": ["abs", "absolute value"], "examples": ["ABS(-1.3)", "ABS(A)"], "syntax": "ABS(value)", "syntax_elements": [{ "element": "value", "description": "The value or series to take the absolute value of." }] }, { "function": "AND", "description": "Returns True if all of the provided arguments are True, and False if any of the provided arguments are False.", "search_terms": ["and", "&", "if", "conditional"], "examples": ["AND(True, False)", "AND(Nums > 100, Nums < 200)", "AND(Pay > 10, Pay < 20, Status == 'active')"], "syntax": "AND(boolean_condition1, [boolean_condition2, ...])", "syntax_elements": [{ "element": "boolean_condition1", "description": "An expression or series that returns True or False values. See IF documentation for a list of conditons." }, { "element": "boolean_condition2 ... [OPTIONAL]", "description": "An expression or series that returns True or False values. See IF documentation for a list of conditons." }] }, { "function": "AVG", "description": "Returns the numerical mean value of the passed numbers and series.", "search_terms": ["avg", "average", "mean"], "examples": ["AVG(1, 2)", "AVG(A, B)", "AVG(A, 2)"], "syntax": "AVG(value1, [value2, ...])", "syntax_elements": [{ "element": "value1", "description": "The first number or series to consider when calculating the average." }, { "element": "value2, ... [OPTIONAL]", "description": "Additional numbers or series to consider when calculating the average." }] }, { "function": "BOOL", "description": "Converts the passed arguments to boolean values, either True or False. For numberic values, 0 converts to False while all other values convert to True.", "search_terms": ["bool", "boolean", "true", "false", "dtype", "convert"], "examples": ["BOOL(Amount_Payed)", "AND(BOOL(Amount_Payed), Is_Paying)"], "syntax": "BOOL(series)", "syntax_elements": [{ "element": "series", "description": "An series to convert to boolean values, either True or False." }] }, { "function": "CLEAN", "description": "Returns the text with the non-printable ASCII characters removed.", "search_terms": ["clean", "trim", "remove"], "examples": ["CLEAN(A)"], "syntax": "CLEAN(string)", "syntax_elements": [{ "element": "string", "description": "The string or series whose non-printable characters are to be removed." }] }, { "function": "CONCAT", "description": "Returns the passed strings and series appended together.", "search_terms": ["&", "concatenate", "append", "combine"], "examples": ["CONCAT('Bite', 'the bullet')", "CONCAT(A, B)"], "syntax": "CONCAT(string1, [string2, ...])", "syntax_elements": [{ "element": "string1", "description": "The first string or series." }, { "element": "string2, ... [OPTIONAL]", "description": "Additional strings or series to append in sequence." }] }, { "function": "CORR", "description": "Computes the correlation between two series, excluding missing values.", "search_terms": ["corr", "correlation", "r^2"], "examples": ["=CORR(A, B)", "=CORR(B, A)"], "syntax": "CORR(series_one, series_two)", "syntax_elements": [{ "element": "series_one", "description": "The number series to convert to calculate the correlation." }, { "element": "series_two", "description": "The number series to convert to calculate the correlation." }] }, { "function": "DATEVALUE", "description": "Converts a given string to a date series.", "search_terms": ["datevalue", "date value", "date", "string to date", "datetime", "dtype", "convert"], "examples": ["DATEVALUE(date_column)", "DATEVALUE('2012-12-22')"], "syntax": "DATEVALUE(date_string)", "syntax_elements": [{ "element": "date_string", "description": "The date string to turn into a date object." }] }, { "function": "DAY", "description": "Returns the day of the month that a specific date falls on, as a number.", "search_terms": ["day", "date"], "examples": ["DAY(date_column)", "DAY('2012-12-22')"], "syntax": "DAY(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the day of." }] }, { "function": "ENDOFBUSINESSMONTH", "description": "Given a date, returns the end of the buisness month. E.g. the last weekday.", "search_terms": ["business", "month", "eom", "eobm", "date", "workday", "end"], "examples": ["ENDOFBUSINESSMONTH(date_column)", "ENDOFBUSINESSMONTH('2012-12-22')"], "syntax": "ENDOFBUSINESSMONTH(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the end of the business month of." }] }, { "function": "ENDOFMONTH", "description": "Given a date, returns the end of the month, as a date. E.g. input of 12-22-1997 will return 12-31-1997.", "search_terms": ["month", "eom", "date", "workday", "end", "eomonth"], "examples": ["ENDOFMONTH(date_column)", "ENDOFMONTH('2012-12-22')"], "syntax": "ENDOFMONTH(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the last day of the month of." }] }, { "function": "EXP", "description": "Returns e, the base of the natural logarithm, raised to the power of passed series.", "search_terms": ["exp", "exponent", "log", "natural log"], "examples": ["=EXP(data)", "=EXP(A)"], "syntax": "EXP(series)", "syntax_elements": [{ "element": "series", "description": "The series to raise e to." }] }, { "function": "FILLNAN", "description": "Replaces the NaN values in the series with the replacement value.", "search_terms": ["fillnan", "nan", "fill nan", "missing values", "null", "null value", "fill null"], "examples": ["FILLNAN(A, 10)", "FILLNAN(A, 'replacement')"], "syntax": "FILLNAN(series, replacement)", "syntax_elements": [{ "element": "series", "description": "The series to replace the NaN values in." }, { "element": "replacement", "description": "A string, number, or date to replace the NaNs with." }] }, { "function": "FIND", "description": "Returns the position at which a string is first found within text, case-sensitive. Returns 0 if not found.", "search_terms": ["find", "search"], "examples": ["FIND(A, 'Jack')", "FIND('Ben has a friend Jack', 'Jack')"], "syntax": "FIND(text_to_search, search_for)", "syntax_elements": [{ "element": "text_to_search", "description": "The text or series to search for the first occurrence of search_for." }, { "element": "search_for", "description": "The string to look for within text_to_search." }] }, { "function": "FLOAT", "description": "Converts a string series to a float series. Any values that fail to convert will return NaN.", "search_terms": ["number", "to number"], "examples": ["=FLOAT(Prices_string)", "=FLOAT('123.123')"], "syntax": "FLOAT(string_series)", "syntax_elements": [{ "element": "string_series", "description": "The series or string to convert to a float." }] }, { "function": "HOUR", "description": "Returns the hour component of a specific date, as a number.", "search_terms": ["hour", "hr"], "examples": ["HOUR(date_column)", "HOUR('2012-12-22 09:45:00')"], "syntax": "HOUR(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the hour of." }] }, { "function": "IF", "description": "Returns one value if the condition is True. Returns the other value if the conditon is False.", "search_terms": ["if", "conditional", "and", "or"], "examples": ["IF(Status == 'success', 1, 0)", "IF(Nums > 100, 100, Nums)", "IF(AND(Grade >= .6, Status == 'active'), 'pass', 'fail')"], "syntax": "IF(boolean_condition, value_if_true, value_if_false)", "syntax_elements": [{ "element": "boolean_condition", "description": "An expression or series that returns True or False values. Valid conditions for comparison include ==, !=, >, <, >=, <=." }, { "element": "value_if_true", "description": "The value the function returns if condition is True." }, { "element": "value_if_false", "description": "The value the function returns if condition is False." }] }, { "function": "INT", "description": "Converts a string series to a int series. Any values that fail to convert will return 0.", "search_terms": ["number", "to integer"], "examples": ["=INT(Prices_string)", "=INT('123')"], "syntax": "INT(string_series)", "syntax_elements": [{ "element": "string_series", "description": "The series or string to convert to a int." }] }, { "function": "KURT", "description": "Computes the unbiased kurtosis, a measure of tailedness, of a series, excluding missing values.", "search_terms": ["kurtosis"], "examples": ["=KURT(A)", "=KURT(A * B)"], "syntax": "KURT(series)", "syntax_elements": [{ "element": "series", "description": "The series to calculate the unbiased kurtosis of." }] }, { "function": "LEFT", "description": "Returns a substring from the beginning of a specified string.", "search_terms": ["left"], "examples": ["LEFT(A, 2)", "LEFT('The first character!')"], "syntax": "LEFT(string, [number_of_characters])", "syntax_elements": [{ "element": "string", "description": "The string or series from which the left portion will be returned." }, { "element": "number_of_characters [OPTIONAL, 1 by default]", "description": "The number of characters to return from the start of string." }] }, { "function": "LEN", "description": "Returns the length of a string.", "search_terms": ["length", "size"], "examples": ["LEN(A)", "LEN('This is 21 characters')"], "syntax": "LEN(string)", "syntax_elements": [{ "element": "string", "description": "The string or series whose length will be returned." }] }, { "function": "LOG", "description": "Calculates the logarithm of the passed series with an optional base.", "search_terms": ["log", "logarithm", "natural log"], "examples": ["LOG(e) = 1", "LOG(100, 10) = 2"], "syntax": "LOG(series, [base])", "syntax_elements": [{ "element": "series", "description": "The series to take the logarithm of." }, { "element": "base [OPTIONAL]", "description": "The base of the logarithm to use. Defaults to the natural logarithm if no base is passed." }] }, { "function": "LOWER", "description": "Converts a given string to lowercase.", "search_terms": ["lowercase", "uppercase"], "examples": ["=LOWER('ABC')", "=LOWER(A)", "=LOWER('Nate Rush')"], "syntax": "LOWER(string)", "syntax_elements": [{ "element": "string", "description": "The string or series to convert to lowercase." }] }, { "function": "MAX", "description": "Returns the maximum value among the passed arguments.", "search_terms": ["max", "maximum", "minimum"], "examples": ["MAX(10, 11)", "MAX(Old_Data, New_Data)"], "syntax": "MAX(value1, [value2, ...])", "syntax_elements": [{ "element": "value1", "description": "The first number or column to consider for the maximum value." }, { "element": "value2, ... [OPTIONAL]", "description": "Additional numbers or columns to compute the maximum value from." }] }, { "function": "MID", "description": "Returns a segment of a string.", "search_terms": ["middle"], "examples": ["MID(A, 2, 2)", "MID('Some middle characters!', 3, 4)"], "syntax": "MID(string, starting_at, extract_length)", "syntax_elements": [{ "element": "string", "description": "The string or series to extract the segment from." }, { "element": "starting_at", "description": "The index from the left of string from which to begin extracting." }, { "element": "extract_length", "description": "The length of the segment to extract." }] }, { "function": "MIN", "description": "Returns the minimum value among the passed arguments.", "search_terms": ["min", "minimum", "maximum"], "examples": ["MIN(10, 11)", "MIN(Old_Data, New_Data)"], "syntax": "MIN(value1, [value2, ...])", "syntax_elements": [{ "element": "value1", "description": "The first number or column to consider for the minumum value." }, { "element": "value2, ... [OPTIONAL]", "description": "Additional numbers or columns to compute the minumum value from." }] }, { "function": "MINUTE", "description": "Returns the minute component of a specific date, as a number.", "search_terms": ["minute", "min"], "examples": ["MINUTE(date_column)", "MINUTE('2012-12-22 09:45:00')"], "syntax": "MINUTE(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the minute of." }] }, { "function": "MONTH", "description": "Returns the month that a specific date falls in, as a number.", "search_terms": ["month", "date"], "examples": ["MONTH(date_column)", "MONTH('2012-12-22')"], "syntax": "MONTH(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the month of." }] }, { "function": "MULTIPLY", "description": "Returns the product of two numbers.", "search_terms": ["mulitply", "product"], "examples": ["MULTIPLY(2,3)", "MULTIPLY(A,3)"], "syntax": "MULTIPLY(factor1, [factor2, ...])", "syntax_elements": [{ "element": "factor1", "description": "The first number to multiply." }, { "element": "factor2, ... [OPTIONAL]", "description": "Additional numbers or series to multiply." }] }, { "function": "OR", "description": "Returns True if any of the provided arguments are True, and False if all of the provided arguments are False.", "search_terms": ["or", "if", "conditional"], "examples": ["OR(True, False)", "OR(Status == 'success', Status == 'pass', Status == 'passed')"], "syntax": "OR(boolean_condition1, [boolean_condition2, ...])", "syntax_elements": [{ "element": "boolean_condition1", "description": "An expression or series that returns True or False values. See IF documentation for a list of conditons." }, { "element": "boolean_condition2 ... [OPTIONAL]", "description": "An expression or series that returns True or False values. See IF documentation for a list of conditons." }] }, { "function": "POWER", "description": "The POWER function can be used to raise a number to a given power.", "search_terms": ["power", "raise", "exponent", "square", "cube"], "examples": ["POWER(4, 1/2)", "POWER(Dose, 2)"], "syntax": "POWER(value, exponent)", "syntax_elements": [{ "element": "value", "description": "Number to raise to a power." }, { "element": "exponent", "description": "The number to raise value to." }] }, { "function": "PROPER", "description": "Capitalizes the first letter of each word in a specified string.", "search_terms": ["proper", "capitalize"], "examples": ["=PROPER('nate nush')", "=PROPER(A)"], "syntax": "PROPER(string)", "syntax_elements": [{ "element": "string", "description": "The value or series to convert to convert to proper case." }] }, { "function": "QUARTER", "description": "Returns the quarter (1-4) that a specific date falls in, as a number.", "search_terms": ["quarter"], "examples": ["QUARTER(date_column)", "QUARTER('2012-12-22')"], "syntax": "QUARTER(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the quarter of." }] }, { "function": "RIGHT", "description": "Returns a substring from the beginning of a specified string.", "search_terms": [], "examples": ["RIGHT(A, 2)", "RIGHT('The last character!')"], "syntax": "RIGHT(string, [number_of_characters])", "syntax_elements": [{ "element": "string", "description": "The string or series from which the right portion will be returned." }, { "element": "number_of_characters [OPTIONAL, 1 by default]", "description": "The number of characters to return from the end of string." }] }, { "function": "ROUND", "description": "Rounds a number to a given number of decimals.", "search_terms": ["round", "decimal", "integer"], "examples": ["ROUND(1.3)", "ROUND(A, 2)"], "syntax": "ROUND(value, [decimals])", "syntax_elements": [{ "element": "value", "description": "The value or series to round." }, { "element": "decimals", "description": " The number of decimals to round to. Default is 0." }] }, { "function": "SECOND", "description": "Returns the seconds component of a specific date, as a number.", "search_terms": ["second", "sec"], "examples": ["SECOND(date_column)", "SECOND('2012-12-22 09:23:05')"], "syntax": "SECOND(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the seconds of." }] }, { "function": "SKEW", "description": "Computes the skew of a series, excluding missing values.", "search_terms": [], "examples": ["=SKEW(A)", "=SKEW(A * B)"], "syntax": "SKEW(series)", "syntax_elements": [{ "element": "series", "description": "The series to calculate the skew of." }] }, { "function": "STARTOFBUSINESSMONTH", "description": "Given a date, returns the most recent start of the business month, as a state. E.g. the first weekday.", "search_terms": ["business", "month", "SOM", "SOBM", "date", "start"], "examples": ["STARTOFBUSINESSMONTH(date_column)", "STARTOFBUSINESSMONTH('2012-12-22 09:23:05')"], "syntax": "STARTOFBUSINESSMONTH(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the most recent beginning of month business day of." }] }, { "function": "STARTOFMONTH", "description": "Given a date, returns the start of the month, as a date. E.g. input of 12-22-1997 will return 12-1-1997.", "search_terms": ["month", "SOM", "date", "start"], "examples": ["STARTOFMONTH(date_column)", "STARTOFMONTH('2012-12-22 09:23:05')"], "syntax": "STARTOFMONTH(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the first day of the month of." }] }, { "function": "STDEV", "description": "Computes the standard deviation of a series, excluding missing values.", "search_terms": ["standard", "deviation", "standard", "distribution"], "examples": ["=STDEV(A)", "=STDEV(A * B)"], "syntax": "STDEV(series)", "syntax_elements": [{ "element": "series", "description": "The series to calculate the standard deviation of." }] }, { "function": "STRIPTIMETODAYS", "description": "Returns the date with a seconds, minutes, and hours component of 00:00:00.", "search_terms": ["time", "date", "days", "strip"], "examples": ["STRIPTIMETODAYS(date_column)", "STRIPTIMETODAYS('2012-12-22 09:23:05')"], "syntax": "STRIPTIMETODAYS(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to reset the seconds, minutes, and hours component of." }] }, { "function": "STRIPTIMETOHOURS", "description": "Returns the date with a seconds and minutes component of 00:00.", "search_terms": ["time", "date", "hours", "strip"], "examples": ["STRIPTIMETOHOURS(date_column)", "STRIPTIMETOHOURS('2012-12-22 09:23:05')"], "syntax": "STRIPTIMETOHOURS(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to reset the seconds and minutes component of." }] }, { "function": "STRIPTIMETOMINUTES", "description": "Returns the date with a seconds component of 00.", "search_terms": ["time", "date", "minutes", "strip"], "examples": ["STRIPTIMETOMINUTES(date_column)", "STRIPTIMETOMINUTES('2012-12-22 09:23:05')"], "syntax": "STRIPTIMETOMINUTES(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to reset the seconds component of." }] }, { "function": "STRIPTIMETOMONTHS", "description": "Returns the date adjusted to the start of the month.", "search_terms": ["time", "date", "months", "strip"], "examples": ["STRIPTIMETOMONTHS(date_column)", "STRIPTIMETOMONTHS('2012-12-22 09:23:05')"], "syntax": "STRIPTIMETOMONTHS(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to reset the seconds, minutes, hours, and days of." }] }, { "function": "STRIPTIMETOYEARS", "description": "Returns the date adjusted to the start of the year.", "search_terms": ["time", "date", "years", "strip"], "examples": ["STRIPTIMETOYEARS(date_column)", "STRIPTIMETOYEARS('2012-12-22 09:23:05')"], "syntax": "STRIPTIMETOYEARS(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to reset the seconds, minutes, hours, days, and month components of." }] }, { "function": "SUBSTITUTE", "description": "Replaces existing text with new text in a string.", "search_terms": ["replace", "find and replace"], "examples": ["SUBSTITUTE('Better great than never', 'great', 'late')", "SUBSTITUTE(A, 'dog', 'cat')"], "syntax": "SUBSTITUTE(text_to_search, search_for, replace_with, [count])", "syntax_elements": [{ "element": "text_to_search", "description": "The text within which to search and replace." }, { "element": "search_for", "description": " The string to search for within text_to_search." }, { "element": "replace_with", "description": "The string that will replace search_for." }, { "element": "count", "description": "The number of times to perform the substitute. Default is all." }] }, { "function": "SUM", "description": "Returns the sum of the given numbers and series.", "search_terms": ["add"], "examples": ["SUM(10, 11)", "SUM(A, B, D, F)", "SUM(A, B, D, F)"], "syntax": "SUM(value1, [value2, ...])", "syntax_elements": [{ "element": "value1", "description": "The first number or column to add together." }, { "element": "value2, ... [OPTIONAL]", "description": "Additional numbers or columns to sum." }] }, { "function": "TEXT", "description": "Turns the passed series into a string.", "search_terms": ["string", "dtype"], "examples": ["=TEXT(Product_Number)", "=TEXT(Start_Date)"], "syntax": "TEXT(series)", "syntax_elements": [{ "element": "series", "description": "The series to convert to a string." }] }, { "function": "TRIM", "description": "Returns a string with the leading and trailing whitespace removed.", "search_terms": ["trim", "whitespace", "spaces"], "examples": ["=TRIM('  ABC')", "=TRIM('  ABC  ')", "=TRIM(A)"], "syntax": "TRIM(string)", "syntax_elements": [{ "element": "string", "description": "The value or series to remove the leading and trailing whitespace from." }] }, { "function": "TYPE", "description": "Returns the type of each element of the passed series. Return values are 'number', 'str', 'bool', 'datetime', 'object', or 'NaN'.", "search_terms": ["type", "dtype"], "examples": ["TYPE(Nums_and_Strings)", "IF(TYPE(Account_Numbers) != 'NaN', Account_Numbers, 0)"], "syntax": "TYPE(series)", "syntax_elements": [{ "element": "series", "description": "The series to get the type of each element of." }] }, { "function": "UPPER", "description": "Converts a given string to uppercase.", "search_terms": ["uppercase", "capitalize"], "examples": ["=UPPER('abc')", "=UPPER(A)", "=UPPER('Nate Rush')"], "syntax": "UPPER(string)", "syntax_elements": [{ "element": "string", "description": "The string or series to convert to uppercase." }] }, { "function": "VALUE", "description": "Converts a string series to a number series. Any values that fail to convert will return an NaN.", "search_terms": ["number", "to number", "dtype", "convert", "parse"], "examples": ["=VALUE(A)", "=VALUE('123')"], "syntax": "VALUE(string)", "syntax_elements": [{ "element": "string", "description": "The string or series to convert to a number." }] }, { "function": "VAR", "description": "Computes the variance of a series, excluding missing values.", "search_terms": ["variance"], "examples": ["=VAR(A)", "=VAR(A - B)"], "syntax": "VAR(series)", "syntax_elements": [{ "element": "series", "description": "The series to calculate the variance of." }] }, { "function": "WEEK", "description": "Returns the week (1-52) of a specific date, as a number.", "search_terms": ["week", "1", "52"], "examples": ["WEEK(date_column)", "WEEK('2012-12-22 09:23:05')"], "syntax": "WEEK(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the week of." }] }, { "function": "WEEKDAY", "description": "Returns the day of the week that a specific date falls on. 1-7 corresponds to Monday-Sunday.", "search_terms": ["weekday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"], "examples": ["WEEKDAY(date_column)", "WEEKDAY('2012-12-22')"], "syntax": "WEEKDAY(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the weekday of." }] }, { "function": "YEAR", "description": "Returns the day of the year that a specific date falls in, as a number.", "search_terms": ["year", "date"], "examples": ["YEAR(date_column)", "YEAR('2012-12-22')"], "syntax": "YEAR(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the month of." }] }];

  // src/components/endo/utils.tsx
  var import_react37 = __toESM(require_react());

  // src/components/endo/widthUtils.tsx
  var getWidthData = (sheetData, defaultWidthData = void 0) => {
    if (sheetData === void 0) {
      return {
        widthArray: [],
        widthSumArray: [],
        totalWidth: 0
      };
    }
    const widthArray = new Array(sheetData.numColumns);
    const widthSumArray = new Array(sheetData.numColumns);
    for (let columnIndex = 0; columnIndex < sheetData.data.length; columnIndex++) {
      const columnID = sheetData.data[columnIndex].columnID;
      let columnWidth = DEFAULT_WIDTH;
      if (defaultWidthData !== void 0) {
        columnWidth = defaultWidthData[columnID] || DEFAULT_WIDTH;
      }
      widthArray[columnIndex] = columnWidth;
      const previousSum = columnIndex === 0 ? 0 : widthSumArray[columnIndex - 1];
      widthSumArray[columnIndex] = previousSum + columnWidth;
    }
    return {
      widthArray,
      widthSumArray,
      totalWidth: widthArray.reduce((partialSum, width) => partialSum + width, 0)
    };
  };
  var changeColumnWidthDataArray = (sheetIndex, widthDataArray, columnIndex, newWidth) => {
    const newWidthArray = [...widthDataArray[sheetIndex].widthArray];
    newWidthArray[columnIndex] = newWidth;
    const newWidthSumArray = [...widthDataArray[sheetIndex].widthSumArray];
    for (let i = columnIndex; i < widthDataArray[sheetIndex].widthSumArray.length; i++) {
      let previousSumSaved = newWidthSumArray[i - 1];
      if (previousSumSaved === void 0) {
        previousSumSaved = 0;
      }
      const columnWidth = newWidthArray[i];
      newWidthSumArray[i] = previousSumSaved + columnWidth;
    }
    const newTotalWidth = newWidthArray.reduce((partialSum, width) => partialSum + width, 0);
    widthDataArray[sheetIndex] = {
      widthArray: newWidthArray,
      widthSumArray: newWidthSumArray,
      totalWidth: newTotalWidth
    };
    return widthDataArray;
  };
  var reconciliateWidthDataArray = (prevWidthDataArray, columnIDsArray, sheetDataArray2) => {
    if (sheetDataArray2.length === 0) {
      return [getWidthData(void 0)];
    }
    const newColumnWidthsArray = [];
    for (let i = 0; i < sheetDataArray2.length; i++) {
      const columnIDs = columnIDsArray[i];
      const newColumnsWidthsResult = reconciliateWidthData(prevWidthDataArray[i], columnIDs, sheetDataArray2[i]);
      newColumnWidthsArray.push(newColumnsWidthsResult);
    }
    return newColumnWidthsArray;
  };
  var reconciliateWidthData = (prevWidthData, oldColumnIDsArray, sheetData) => {
    const oldWidths = {};
    if (prevWidthData !== void 0 && oldColumnIDsArray !== void 0) {
      for (let i = 0; i < oldColumnIDsArray.length; i++) {
        oldWidths[oldColumnIDsArray[i]] = prevWidthData.widthArray[i];
      }
    }
    return getWidthData(sheetData, oldWidths);
  };
  var guessFullWidthOfColumnHeaderOrContent = (sheetData, columnIndex, displayColumnHeader) => {
    const displayColumnHeaderPx = displayColumnHeader.length * 10 + 15;
    const dataMaxLength = Math.max(...sheetData.data[columnIndex].columnData.map((el) => String(el).length)) * 8;
    return Math.max(displayColumnHeaderPx, dataMaxLength);
  };
  var getWidthArrayAtFullWidthForColumnIndexes = (columnIndexes, gridState, sheetData) => {
    let widthDataArray = gridState.widthDataArray;
    columnIndexes.forEach((columnIndex) => {
      const columnHeader = getCellDataFromCellIndexes(sheetData, -1, columnIndex).columnHeader;
      if (columnHeader === void 0) {
        return;
      }
      const displayColumnHeader = getDisplayColumnHeader(columnHeader);
      const fullWidth = guessFullWidthOfColumnHeaderOrContent(sheetData, columnIndex, displayColumnHeader);
      widthDataArray = changeColumnWidthDataArray(gridState.sheetIndex, widthDataArray, columnIndex, fullWidth);
    });
    return widthDataArray;
  };

  // src/components/endo/utils.tsx
  var isNumberInRangeInclusive = (num, start, end) => {
    return start <= num && num <= end;
  };
  function firstNonNullOrUndefined(...args) {
    for (let i = 0; i < args.length; i++) {
      const arg = args[i];
      if (arg !== null && arg !== void 0) {
        return arg;
      }
    }
    return args[0];
  }
  var getDefaultGridState = (sheetDataArray2, selectedSheetIndex) => {
    return {
      sheetIndex: selectedSheetIndex,
      viewport: {
        width: 0,
        height: 0
      },
      scrollPosition: {
        scrollLeft: 0,
        scrollTop: 0
      },
      selections: [{
        startingColumnIndex: 0,
        endingColumnIndex: 0,
        startingRowIndex: -1,
        endingRowIndex: -1
      }],
      copiedSelections: [],
      widthDataArray: sheetDataArray2.length === 0 ? [getWidthData(void 0)] : sheetDataArray2.map((sheetData) => getWidthData(sheetData)),
      columnIDsArray: getColumnIDsArrayFromSheetDataArray(sheetDataArray2)
    };
  };
  var getTypeIdentifier = (columnDtype, purpleOrDark) => {
    let typeText = "str";
    if (isFloatDtype(columnDtype)) {
      typeText = "float";
    } else if (isIntDtype(columnDtype)) {
      typeText = "int";
    } else if (isDatetimeDtype(columnDtype)) {
      typeText = "date";
    } else if (isTimedeltaDtype(columnDtype)) {
      typeText = "time";
    } else if (isBoolDtype(columnDtype)) {
      typeText = "bool";
    }
    return /* @__PURE__ */ import_react37.default.createElement(
      "p",
      {
        className: classNames(
          "text-subtext-1",
          { "text-color-mito-purple-important": purpleOrDark === "purple" },
          { "text-color-gray-important": purpleOrDark === "dark" }
        )
      },
      typeText
    );
  };
  var getCellDataFromCellIndexes = (sheetData, rowIndex, columnIndex) => {
    var _a, _b;
    const columnID = (_a = sheetData == null ? void 0 : sheetData.data[columnIndex]) == null ? void 0 : _a.columnID;
    const columnHeader = (_b = sheetData == null ? void 0 : sheetData.data[columnIndex]) == null ? void 0 : _b.columnHeader;
    const indexLabel = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.index[rowIndex] : void 0;
    const columnDtype = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.data[columnIndex].columnDtype : void 0;
    const columnFormulaAndLocation = columnID !== void 0 ? sheetData !== void 0 ? sheetData == null ? void 0 : sheetData.columnFormulasMap[columnID] : [] : [];
    let columnFormula;
    let columnFormulaLocation;
    if (columnFormulaAndLocation.length !== 0) {
      columnFormulaAndLocation.forEach((cfal) => {
        if (cfal.location.type === "entire_column") {
          columnFormula = getFormulaStringFromFrontendFormula(cfal, indexLabel, sheetData);
          columnFormulaLocation = "entire_column";
        } else if (indexLabel !== void 0 && cfal.location.index_labels.includes(indexLabel)) {
          columnFormula = getFormulaStringFromFrontendFormula(cfal, indexLabel, sheetData);
          columnFormulaLocation = "specific_index_labels";
        }
      });
    }
    const columnFilters = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.columnFiltersMap[columnID] : void 0;
    const cellValue = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.data[columnIndex].columnData[rowIndex] : void 0;
    const columnFormat = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.dfFormat.columns[columnID] : void 0;
    const headerBackgroundColor = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.dfFormat.headers.backgroundColor : void 0;
    const headerTextColor = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.dfFormat.headers.color : void 0;
    return {
      columnID,
      columnHeader,
      columnFormula,
      columnFormulaLocation,
      columnDtype,
      columnFilters,
      cellValue,
      columnFormat,
      headerBackgroundColor,
      headerTextColor,
      indexLabel
    };
  };
  var getColumnIDsArrayFromSheetDataArray = (sheetDataArray2) => {
    return sheetDataArray2.map((sheetData) => sheetData.data.map((c) => c.columnID)) || [];
  };
  var doesAnySheetExist = (sheetDataArray2) => {
    return sheetDataArray2.length !== 0;
  };
  var doesColumnExist = (columnID, sheetIndex, sheetDataArray2) => {
    var _a;
    return columnID !== void 0 && ((_a = sheetDataArray2[sheetIndex]) == null ? void 0 : _a.columnDtypeMap[columnID]) !== void 0;
  };
  var doesSheetContainData = (sheetIndex, sheetDataArray2) => {
    const sheetData = sheetDataArray2[sheetIndex];
    return sheetData !== void 0 && sheetData.numRows > 0 && sheetData.numColumns > 0;
  };
  var getGraphIsSelected = (uiState) => {
    return uiState.selectedTabType === "graph" && uiState.selectedGraphID !== void 0;
  };
  var getDataframeIsSelected = (uiState, sheetDataArray2) => {
    return uiState.selectedTabType === "data" && sheetDataArray2.length !== 0;
  };
  var hexToRGB = (hex, alpha) => {
    if (hex === null) {
      return void 0;
    }
    const r = parseInt(hex.slice(1, 3), 16);
    const g = parseInt(hex.slice(3, 5), 16);
    const b = parseInt(hex.slice(5, 7), 16);
    if (alpha) {
      return "rgba(" + r + ", " + g + ", " + b + ", " + alpha + ")";
    } else {
      return "rgb(" + r + ", " + g + ", " + b + ")";
    }
  };

  // src/components/endo/celleditor/cellEditorUtils.tsx
  var getSelectionFormulaString = (selections, sheetData, rowIndex) => {
    const columnHeadersAndIndexLabels = [];
    selections.forEach((selection) => {
      if (isSelectionEntireSelectedColumn(selection)) {
        const entireSelectedColumns = getSelectedColumnIDsWithEntireSelectedColumn([selection], sheetData);
        entireSelectedColumns.forEach((columnID) => {
          const columnHeader = sheetData.columnIDsMap[columnID];
          const formulaIndexLabel = sheetData.index[rowIndex];
          if (columnHeader !== void 0 && formulaIndexLabel !== void 0) {
            columnHeadersAndIndexLabels.push(getDisplayColumnHeader(columnHeader) + getDisplayColumnHeader(formulaIndexLabel));
          }
        });
        return;
      }
      const columnHeaders = getColumnHeadersInSelection(selection, sheetData);
      const indexLabels = getIndexLabelsInSelection(selection, sheetData);
      columnHeaders.forEach((columnHeader) => {
        indexLabels.forEach((indexLabel) => {
          columnHeadersAndIndexLabels.push(getDisplayColumnHeader(columnHeader) + getDisplayColumnHeader(indexLabel));
        });
      });
    });
    return columnHeadersAndIndexLabels.join(", ");
  };
  var getFullFormula = (formula, pendingSelections, sheetData, rowIndex) => {
    if (pendingSelections === void 0 || pendingSelections.selections.length === 0) {
      return formula;
    }
    const selectionFormulaString = getSelectionFormulaString(pendingSelections.selections, sheetData, rowIndex);
    const beforeSelection = formula.substring(0, pendingSelections.inputSelectionStart);
    const afterSelection = formula.substring(pendingSelections.inputSelectionEnd);
    return beforeSelection + selectionFormulaString + afterSelection;
  };
  var getCellEditorInputCurrentSelection = (containerDiv) => {
    const cellEditorElement = containerDiv == null ? void 0 : containerDiv.querySelector(".cell-editor-input");
    if (cellEditorElement === null) {
      return {
        selectionStart: 0,
        selectionEnd: 0
      };
    }
    const cellEditorInput = cellEditorElement;
    return {
      selectionStart: cellEditorInput.selectionStart || 0,
      selectionEnd: cellEditorInput.selectionEnd || 0
    };
  };
  var KEYS_TO_ENTER_CELL_EDITING_MODE_EMPTY = [
    "Enter",
    "Backspace"
  ];
  var getStartingFormula = (sheetData, editorState, rowIndex, columnIndex, e) => {
    if (editorState !== void 0 && editorState.columnIndex === columnIndex) {
      return {
        startingColumnFormula: editorState.formula,
        arrowKeysScrollInFormula: true,
        editingMode: editorState.editingMode
      };
    }
    const { columnFormula, columnHeader, columnFormulaLocation } = getCellDataFromCellIndexes(sheetData, rowIndex, columnIndex);
    if (columnHeader === void 0) {
      return {
        startingColumnFormula: "",
        arrowKeysScrollInFormula: false,
        editingMode: "entire_column"
      };
    }
    let originalValue = "";
    if (rowIndex <= -1) {
      if (columnHeader === void 0) {
        originalValue = "";
      } else if (isPrimitiveColumnHeader(columnHeader)) {
        originalValue = getDisplayColumnHeader(columnHeader);
      } else {
        originalValue = getDisplayColumnHeader(columnHeader[rowIndexToColumnHeaderLevel(columnHeader, rowIndex)]);
      }
    } else {
      if (columnFormula === void 0 || columnFormula === "") {
        originalValue = "=" + getDisplayColumnHeader(columnHeader);
      } else {
        originalValue = columnFormula;
      }
    }
    if (e !== void 0) {
      if (e.key === "Backspace") {
        originalValue = originalValue.substr(0, originalValue.length - 1);
      } else {
        originalValue += KEYS_TO_ENTER_CELL_EDITING_MODE_EMPTY.includes(e.key) ? "" : e.key;
      }
    }
    const defaultFormula = `=${getDisplayColumnHeader(columnHeader)}`;
    if (originalValue === defaultFormula) {
      return {
        startingColumnFormula: "",
        arrowKeysScrollInFormula: false,
        editingMode: "entire_column"
      };
    }
    return {
      startingColumnFormula: originalValue,
      arrowKeysScrollInFormula: true,
      editingMode: columnFormulaLocation || "entire_column"
    };
  };
  var formulaEndsInReference = (formula, indexLabel, sheetData) => {
    const possibleReferences = sheetData.data.map((c) => getDisplayColumnHeader(c.columnHeader) + getDisplayColumnHeader(indexLabel));
    const endingReferences = possibleReferences.filter((reference) => formula.toLowerCase().endsWith(reference.toLowerCase()));
    return endingReferences.length > 0;
  };
  var getSuggestedColumnHeaders = (formula, columnID, sheetData) => {
    const columnHeadersAndIDs = sheetData.data.map((c) => [c.columnID, getDisplayColumnHeader(c.columnHeader)]);
    const maxColumnHeaderLength = Math.min(Math.max(...columnHeadersAndIDs.map(([, columnHeader]) => columnHeader.length), formula.length), 50);
    for (let i = maxColumnHeaderLength; i > 0; i--) {
      const substring = formula.substring(formula.length - i).toLowerCase();
      const charBeforeSubstringStarts = formula[formula.length - i - 1];
      if (substring === "" || charBeforeSubstringStarts && charBeforeSubstringStarts.match(/^[0-9a-z]+$/i)) {
        continue;
      }
      const foundColumns = columnHeadersAndIDs.filter(([, columnHeader]) => columnHeader.toLowerCase().startsWith(substring));
      const suggestedColumnHeaders = foundColumns.map(([columnID2, columnHeader]) => {
        const columnDtype = sheetData.columnDtypeMap[columnID2];
        const subtextType = columnDtype === void 0 ? "series" : columnDtype + " series";
        return [columnHeader, `A ${subtextType} in your dataset`];
      });
      if (suggestedColumnHeaders.length > 0) {
        return [substring.length, suggestedColumnHeaders];
      }
    }
    return [0, []];
  };
  var getSuggestedFunctions = (formula, minLength) => {
    if (formula.length === 0) {
      const placeholders = functionDocumentationObjects.filter((f) => f.function === "LEFT" || f.function === "DAY" || f.function === "VALUE");
      const temp = placeholders[0];
      placeholders[0] = placeholders[1];
      placeholders[1] = temp;
      return [0, placeholders.map((f) => {
        return [f.function, f.description];
      })];
    }
    const maxFunctionNameLength = Math.max(...functionDocumentationObjects.map((f) => f.function.length));
    for (let i = maxFunctionNameLength; i > minLength - 1; i--) {
      const substring = formula.substring(formula.length - i).toLowerCase();
      const charBeforeSubstringStarts = formula[formula.length - i - 1];
      if (substring === "" || charBeforeSubstringStarts && charBeforeSubstringStarts.match(/^[0-9a-z]+$/i)) {
        continue;
      }
      const foundFunctionObjects = functionDocumentationObjects.filter((f) => {
        if (f.function.toLowerCase().startsWith(substring)) {
          return true;
        } else {
          for (let i2 = 0; i2 < f.search_terms.length; i2++) {
            const searchTerm = f.search_terms[i2];
            if (searchTerm.toLowerCase().startsWith(substring)) {
              return true;
            }
          }
        }
        return false;
      });
      const suggestedFunctions = foundFunctionObjects.map((f) => {
        return [f.function, f.description];
      });
      if (suggestedFunctions.length > 0) {
        return [substring.length, suggestedFunctions];
      }
    }
    return [0, []];
  };
  var getDocumentationFunction = (formula) => {
    const finalParenIndex = formula.lastIndexOf("(");
    if (finalParenIndex === -1) {
      return void 0;
    }
    let finalFunction = "";
    for (let i = finalParenIndex - 1; i >= 0; i--) {
      const char = formula[i].toLowerCase();
      if (char.match(/^[a-z]+$/i)) {
        finalFunction += char;
      } else {
        break;
      }
    }
    finalFunction = finalFunction.split("").reverse().join("").toLowerCase();
    const matchingFunctions = functionDocumentationObjects.filter((functionDocumentationObject) => functionDocumentationObject.function.toLowerCase() === finalFunction);
    if (matchingFunctions.length !== 1) {
      return void 0;
    } else {
      return matchingFunctions[0];
    }
  };
  var getNewIndexLabelAtRowOffsetFromOtherIndexLabel = (index, indexLabel, rowOffset) => {
    if (indexLabel === void 0) {
      return void 0;
    }
    const indexOfIndexLabel = index.indexOf(indexLabel);
    if (indexOfIndexLabel === -1) {
      return void 0;
    }
    const indexOfNewLabel = indexOfIndexLabel - rowOffset;
    return index[indexOfNewLabel];
  };
  var getFormulaStringFromFrontendFormula = (formula, indexLabel, sheetData) => {
    let formulaString = "";
    if (!formula || !sheetData) {
      return formulaString;
    }
    formula.frontend_formula.forEach((formulaPart) => {
      if (formulaPart.type === "string part") {
        formulaString += formulaPart.string;
      } else {
        const newIndexLabel = getNewIndexLabelAtRowOffsetFromOtherIndexLabel(formula.index, indexLabel, formulaPart.row_offset);
        if (newIndexLabel !== void 0) {
          formulaString += formulaPart.display_column_header;
          formulaString += getDisplayColumnHeader(newIndexLabel);
        } else {
          formulaString += "0";
        }
      }
    });
    return formulaString;
  };

  // src/components/endo/domUtils.tsx
  var checkElementIsVisible = (element) => {
    if (element === void 0)
      return false;
    const rect = element.getBoundingClientRect();
    const left = rect.left + 2;
    const right = rect.right - 2;
    const top = rect.top + 2;
    const bottom = rect.bottom - 2;
    const atTopleft = document.elementFromPoint(left, top) === element;
    const atTopRight = document.elementFromPoint(right, top) === element;
    const atBottomLeft = document.elementFromPoint(left, bottom) === element;
    const atBottomRight = document.elementFromPoint(right, bottom) === element;
    if (atTopleft && atTopRight && atBottomLeft && atBottomRight) {
      return true;
    }
    return false;
  };
  var getChildrenWithQuery = (element, querySelector) => {
    if (element === null) {
      return [];
    }
    const nodeList = element.querySelectorAll(querySelector);
    if (nodeList === void 0) {
      return [];
    }
    const children = [];
    nodeList.forEach((node) => {
      children.push(node);
    });
    return children;
  };
  var isAnyElementWithSelectorEntirelyVisible = (element, querySelector) => {
    const nodeList = getChildrenWithQuery(element, querySelector);
    for (let i = 0; i < nodeList.length; i++) {
      const node = nodeList[i];
      if (checkElementIsVisible(node)) {
        return true;
      }
    }
    return false;
  };

  // src/components/endo/sheetViewUtils.tsx
  var calculateCurrentSheetView = (gridState) => {
    if (gridState.sheetIndex >= gridState.widthDataArray.length) {
      return {
        startingRowIndex: -1,
        numRowsRendered: 0,
        startingColumnIndex: 0,
        numColumnsRendered: 0
      };
    }
    let foundStart = false;
    let startingColumnIndex = 0;
    let numColumnsRendered = 0;
    for (let i = 0; i < gridState.widthDataArray[gridState.sheetIndex].widthArray.length; i++) {
      const totalWidth = gridState.widthDataArray[gridState.sheetIndex].widthSumArray[i];
      if (!foundStart && totalWidth > gridState.scrollPosition.scrollLeft) {
        startingColumnIndex = i;
        foundStart = true;
      }
      if (foundStart && totalWidth > gridState.scrollPosition.scrollLeft + gridState.viewport.width) {
        numColumnsRendered = i - startingColumnIndex + 1;
        break;
      } else if (i === gridState.widthDataArray[gridState.sheetIndex].widthArray.length - 1) {
        numColumnsRendered = i - startingColumnIndex + 1;
      }
    }
    return {
      startingRowIndex: Math.max(Math.floor(gridState.scrollPosition.scrollTop / DEFAULT_HEIGHT), 0),
      numRowsRendered: Math.ceil(gridState.viewport.height / DEFAULT_HEIGHT) + 3,
      startingColumnIndex,
      numColumnsRendered
    };
  };
  var calculateTranslate = (gridState) => {
    const currentSheetView = calculateCurrentSheetView(gridState);
    return {
      x: gridState.scrollPosition.scrollLeft - (currentSheetView.startingColumnIndex === 0 ? 0 : gridState.widthDataArray[gridState.sheetIndex].widthSumArray[currentSheetView.startingColumnIndex - 1]),
      y: gridState.scrollPosition.scrollTop % DEFAULT_HEIGHT
    };
  };
  var calculateNewScrollPosition = (e, totalSize, viewport, scrollAndRenderedContainerDiv) => {
    const maxScrollLeft = totalSize.width - viewport.width;
    const maxScrollTop = totalSize.height - viewport.height;
    const noScrollLeft = totalSize.width < ((scrollAndRenderedContainerDiv == null ? void 0 : scrollAndRenderedContainerDiv.clientWidth) || 0);
    const noScrollDown = totalSize.height < ((scrollAndRenderedContainerDiv == null ? void 0 : scrollAndRenderedContainerDiv.clientHeight) || 0);
    const target = e.target;
    if (target === null) {
      return void 0;
    }
    const { scrollLeft, scrollTop } = target;
    let newScrollLeft = scrollLeft;
    let newScrollTop = scrollTop;
    if (scrollLeft >= maxScrollLeft && !noScrollLeft) {
      newScrollLeft = maxScrollLeft - 1;
    } else if (noScrollLeft) {
      newScrollLeft = 0;
    }
    if (scrollTop >= maxScrollTop && !noScrollDown) {
      newScrollTop = maxScrollTop;
    } else if (noScrollDown) {
      newScrollTop = 0;
    }
    return {
      scrollLeft: newScrollLeft || 0,
      scrollTop: newScrollTop || 0
    };
  };
  var rowIsVisible = (containerRef, rowIndex) => {
    if (containerRef === null) {
      return false;
    }
    return isAnyElementWithSelectorEntirelyVisible(containerRef, `[mito-row-index="${rowIndex}"]`);
  };
  var columnIsVisible = (containerRef, columnIndex) => {
    if (containerRef === null) {
      return false;
    }
    return isAnyElementWithSelectorEntirelyVisible(containerRef, `[mito-col-index="${columnIndex}"][mito-row-index]`);
  };
  var getCellInRow = (containerRef, rowIndex) => {
    if (containerRef === null) {
      return void 0;
    }
    const nodeList = containerRef.querySelectorAll(`[mito-row-index="${rowIndex}"]`);
    if (nodeList === void 0 || nodeList.length === 0) {
      return void 0;
    }
    return nodeList[0];
  };
  var getCellInColumn = (containerRef, columnIndex) => {
    if (containerRef === null) {
      return void 0;
    }
    const nodeList = containerRef.querySelectorAll(`[mito-col-index="${columnIndex}"]`);
    if (nodeList === void 0 || nodeList.length === 0) {
      return void 0;
    }
    return nodeList[0];
  };

  // src/components/endo/celleditor/CellEditor.tsx
  var import_react39 = __toESM(require_react());

  // src/components/elements/LoadingDots.tsx
  var import_react38 = __toESM(require_react());
  var LoadingDots = () => {
    const [indicatorState, setIndicatorState] = (0, import_react38.useState)(1);
    (0, import_react38.useEffect)(() => {
      const interval = setInterval(() => {
        setIndicatorState((indicatorState2) => indicatorState2 + 1);
      }, 500);
      return () => clearInterval(interval);
    }, []);
    const someNumberOfDots = ".".repeat(indicatorState % 4);
    return /* @__PURE__ */ import_react38.default.createElement(import_react38.default.Fragment, null, someNumberOfDots);
  };
  var LoadingDots_default = LoadingDots;

  // src/components/endo/columnHeaderUtils.tsx
  var submitRenameColumnHeader = (columnHeader, finalColumnHeader, columnID, sheetIndex, editorState, setUIState, mitoAPI) => {
    const newColumnHeader = (editorState == null ? void 0 : editorState.formula) || getDisplayColumnHeader(finalColumnHeader);
    const oldColumnHeader = getDisplayColumnHeader(finalColumnHeader);
    if (newColumnHeader !== oldColumnHeader) {
      const levelIndex = isPrimitiveColumnHeader(columnHeader) ? void 0 : rowIndexToColumnHeaderLevel(columnHeader, -1);
      void mitoAPI.editRenameColumn(
        sheetIndex,
        columnID,
        newColumnHeader,
        levelIndex
      );
      setUIState((prevUIState) => {
        if (prevUIState.currOpenTaskpane.type !== "control_panel" /* CONTROL_PANEL */) {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenTaskpane: { type: "none" /* NONE */ }
          });
        }
        return prevUIState;
      });
    }
  };

  // src/components/endo/focusUtils.tsx
  var focusGrid = (containerDiv) => {
    if (containerDiv) {
      containerDiv.focus();
    }
  };

  // src/components/endo/visibilityUtils.tsx
  var scrollRowIntoView = (containerDiv, scrollAndRenderedContainerDiv, currentSheetView, rowIndex) => {
    if (rowIndex === -1) {
      return;
    }
    if (scrollAndRenderedContainerDiv === null)
      return;
    let scrollTop = scrollAndRenderedContainerDiv.scrollTop;
    const rowVisible = rowIsVisible(containerDiv, rowIndex);
    if (!rowVisible) {
      const newCellIsAbove = rowIndex <= currentSheetView.startingRowIndex;
      if (newCellIsAbove) {
        scrollTop = rowIndex * DEFAULT_HEIGHT;
      } else {
        scrollTop = (rowIndex + 1) * DEFAULT_HEIGHT - scrollAndRenderedContainerDiv.clientHeight;
      }
    }
    scrollAndRenderedContainerDiv.scrollTop = scrollTop;
  };
  var scrollColumnIntoView = (containerDiv, scrollAndRenderedContainerDiv, currentSheetView, gridState, columnIndex) => {
    var _a, _b;
    if (columnIndex === -1) {
      return;
    }
    if (scrollAndRenderedContainerDiv === null)
      return;
    let scrollLeft = scrollAndRenderedContainerDiv.scrollLeft;
    const columnVisible = columnIsVisible(containerDiv, columnIndex);
    if (!columnVisible) {
      const newCellIsLeft = columnIndex <= currentSheetView.startingColumnIndex;
      if (newCellIsLeft) {
        scrollLeft = ((_a = gridState.widthDataArray[gridState.sheetIndex]) == null ? void 0 : _a.widthSumArray[columnIndex - 1]) || 0;
      } else {
        scrollLeft = ((_b = gridState.widthDataArray[gridState.sheetIndex]) == null ? void 0 : _b.widthSumArray[columnIndex]) - scrollAndRenderedContainerDiv.clientWidth || 0;
      }
    }
    scrollAndRenderedContainerDiv.scrollLeft = scrollLeft;
  };
  var ensureCellVisible = (containerDiv, scrollAndRenderedContainerDiv, currentSheetView, gridState, rowIndex, columnIndex) => {
    const largeRowJump = !isNumberInRangeInclusive(rowIndex, currentSheetView.startingRowIndex - 2, currentSheetView.startingRowIndex + currentSheetView.numRowsRendered + 1);
    const largeColumnJump = !isNumberInRangeInclusive(columnIndex, currentSheetView.startingColumnIndex - 2, currentSheetView.startingColumnIndex + currentSheetView.numColumnsRendered + 1);
    const largeJump = largeRowJump || largeColumnJump;
    const rowVisible = rowIsVisible(containerDiv, rowIndex);
    const columnVisible = columnIsVisible(containerDiv, columnIndex);
    if (!rowVisible) {
      if (!largeJump) {
        scrollRowIntoView(containerDiv, scrollAndRenderedContainerDiv, currentSheetView, rowIndex);
      } else {
        setTimeout(() => scrollRowIntoView(containerDiv, scrollAndRenderedContainerDiv, currentSheetView, rowIndex), 25);
      }
    }
    if (!columnVisible) {
      if (!largeJump) {
        scrollColumnIntoView(containerDiv, scrollAndRenderedContainerDiv, currentSheetView, gridState, columnIndex);
      } else {
        setTimeout(() => scrollColumnIntoView(containerDiv, scrollAndRenderedContainerDiv, currentSheetView, gridState, columnIndex), 50);
      }
    }
  };

  // src/components/endo/celleditor/CellEditor.tsx
  var MAX_SUGGESTIONS = 4;
  var CELL_EDITOR_WIDTH = 250;
  var CellEditor = (props) => {
    var _a;
    const cellEditorInputRef = (0, import_react39.useRef)(null);
    const [selectedSuggestionIndex, setSavedSelectedSuggestionIndex] = (0, import_react39.useState)(-1);
    const [loading, setLoading] = (0, import_react39.useState)(false);
    const [cellEditorError, setCellEditorError] = (0, import_react39.useState)(void 0);
    const { columnID, columnHeader, indexLabel } = getCellDataFromCellIndexes(props.sheetData, props.editorState.rowIndex, props.editorState.columnIndex);
    const setRef = (0, import_react39.useCallback)((unsavedInputAnchor) => {
      if (unsavedInputAnchor !== null) {
        cellEditorInputRef.current = unsavedInputAnchor;
        setTimeout(() => {
          var _a2;
          (_a2 = cellEditorInputRef.current) == null ? void 0 : _a2.focus();
        }, 50);
      }
    }, []);
    (0, import_react39.useEffect)(() => {
      setTimeout(() => {
        var _a2, _b;
        (_a2 = cellEditorInputRef.current) == null ? void 0 : _a2.focus();
        if (props.editorState.pendingSelections !== void 0) {
          const index = props.editorState.pendingSelections.inputSelectionStart + getSelectionFormulaString(props.editorState.pendingSelections.selections, props.sheetData, props.editorState.rowIndex).length;
          (_b = cellEditorInputRef.current) == null ? void 0 : _b.setSelectionRange(
            index,
            index
          );
        }
      });
    }, [props.editorState.pendingSelections]);
    (0, import_react39.useEffect)(() => {
      props.setEditorState((prevEditingState) => {
        if (prevEditingState === void 0) {
          return prevEditingState;
        }
        const startingColumnFormula = getStartingFormula(props.sheetData, prevEditingState, props.editorState.rowIndex, props.editorState.columnIndex).startingColumnFormula;
        return __spreadProps(__spreadValues({}, prevEditingState), {
          formula: startingColumnFormula
        });
      });
    }, [props.editorState.editingMode]);
    if (columnID === void 0 || columnHeader === void 0 || indexLabel === void 0) {
      return /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null);
    }
    const fullFormula = getFullFormula(props.editorState.formula, props.editorState.pendingSelections, props.sheetData, props.editorState.rowIndex);
    const endsInReference = formulaEndsInReference(fullFormula, indexLabel, props.sheetData);
    const documentationFunction = getDocumentationFunction(fullFormula);
    const [suggestedColumnHeadersReplacementLength, suggestedColumnHeaders] = getSuggestedColumnHeaders(props.editorState.formula, columnID, props.sheetData);
    const [suggestedFunctionsReplacementLength, suggestedFunctions] = getSuggestedFunctions(props.editorState.formula, suggestedColumnHeadersReplacementLength);
    const hasSuggestions = suggestedColumnHeaders.length > 0 || suggestedFunctions.length > 0;
    const closeCellEditor = () => {
      props.setGridState((gridState) => {
        return __spreadProps(__spreadValues({}, gridState), {
          selection: [{
            startingRowIndex: props.editorState.rowIndex,
            endingRowIndex: props.editorState.rowIndex,
            startingColumnIndex: props.editorState.columnIndex,
            endingColumnIndex: props.editorState.columnIndex
          }]
        });
      });
      props.setEditorState(void 0);
      ensureCellVisible(
        props.containerRef.current,
        props.scrollAndRenderedContainerRef.current,
        props.currentSheetView,
        props.gridState,
        props.editorState.rowIndex,
        props.editorState.columnIndex
      );
      setTimeout(() => focusGrid(props.containerRef.current), 100);
    };
    const takeSuggestion = (suggestionIndex) => {
      var _a2;
      if (suggestionIndex === -1) {
        return;
      }
      let suggestionReplacementLength = 0;
      let suggestion = "";
      let isColumnHeaderSuggestion = true;
      if (suggestionIndex < suggestedColumnHeaders.length) {
        suggestionReplacementLength = suggestedColumnHeadersReplacementLength;
        suggestion = suggestedColumnHeaders[suggestionIndex][0];
      } else {
        suggestionReplacementLength = suggestedFunctionsReplacementLength;
        suggestion = suggestedFunctions[suggestionIndex - suggestedColumnHeaders.length][0] + "(";
        isColumnHeaderSuggestion = false;
      }
      let fullFormula2 = getFullFormula(
        props.editorState.formula,
        props.editorState.pendingSelections,
        props.sheetData,
        props.editorState.rowIndex
      );
      fullFormula2 = fullFormula2.substr(0, fullFormula2.length - suggestionReplacementLength);
      fullFormula2 += suggestion;
      if (isColumnHeaderSuggestion) {
        fullFormula2 += getDisplayColumnHeader(indexLabel);
      }
      props.setEditorState(__spreadProps(__spreadValues({}, props.editorState), {
        formula: fullFormula2,
        pendingSelections: void 0,
        arrowKeysScrollInFormula: props.editorState.editorLocation === "formula bar" ? true : false
      }));
      (_a2 = cellEditorInputRef.current) == null ? void 0 : _a2.setSelectionRange(
        fullFormula2.length,
        fullFormula2.length
      );
    };
    const onKeyDown = (e) => {
      e.stopPropagation();
      e.persist();
      setCellEditorError(void 0);
      if (KEYS_TO_IGNORE_IF_PRESSED_ALONE.includes(e.key)) {
        return;
      }
      const altPressed = e.altKey;
      const arrowKeysScrollInFormula = props.editorState.arrowKeysScrollInFormula === true;
      if (isNavigationKeyPressed(e.key) && !altPressed) {
        const arrowUp = e.key === "Up" || e.key === "ArrowUp";
        const arrowDown = e.key === "Down" || e.key === "ArrowDown";
        if (!endsInReference && (arrowUp || arrowDown) && (suggestedColumnHeaders.length > 0 || suggestedFunctions.length > 0)) {
          e.preventDefault();
          if (arrowUp) {
            setSavedSelectedSuggestionIndex((suggestionIndex) => Math.max(suggestionIndex - 1, -1));
          } else if (arrowDown) {
            setSavedSelectedSuggestionIndex((suggestionIndex) => Math.min(suggestionIndex + 1, suggestedColumnHeaders.length + suggestedFunctions.length - 1, MAX_SUGGESTIONS));
          }
          props.setEditorState((prevEditorState) => {
            if (prevEditorState === void 0)
              return void 0;
            return __spreadProps(__spreadValues({}, prevEditorState), {
              arrowKeysScrollInFormula: true
            });
          });
        } else if (e.key === "Tab") {
          e.preventDefault();
          takeSuggestion(selectedSuggestionIndex);
        } else if (!arrowKeysScrollInFormula) {
          e.preventDefault();
          props.setGridState((gridState) => {
            var _a2, _b, _c, _d;
            const newSelection = getNewSelectionAfterKeyPress(gridState.selections[gridState.selections.length - 1], e, props.sheetData);
            const newInputSelectionStart = firstNonNullOrUndefined(
              (_a2 = props.editorState.pendingSelections) == null ? void 0 : _a2.inputSelectionStart,
              (_b = cellEditorInputRef.current) == null ? void 0 : _b.selectionStart,
              0
            );
            const newInputSelectionEnd = firstNonNullOrUndefined(
              (_c = props.editorState.pendingSelections) == null ? void 0 : _c.inputSelectionEnd,
              (_d = cellEditorInputRef.current) == null ? void 0 : _d.selectionEnd,
              0
            );
            props.setEditorState(__spreadProps(__spreadValues({}, props.editorState), {
              pendingSelections: {
                selections: [newSelection],
                inputSelectionStart: newInputSelectionStart,
                inputSelectionEnd: newInputSelectionEnd
              }
            }));
            ensureCellVisible(
              props.containerRef.current,
              props.scrollAndRenderedContainerRef.current,
              props.currentSheetView,
              props.gridState,
              newSelection.endingRowIndex,
              newSelection.endingColumnIndex
            );
            return __spreadProps(__spreadValues({}, gridState), {
              selections: [newSelection]
            });
          });
        }
      } else if (e.key === "Escape") {
        e.preventDefault();
        closeCellEditor();
      } else if (e.key !== "Enter") {
        setSavedSelectedSuggestionIndex(-1);
        props.setGridState((gridState) => {
          return __spreadProps(__spreadValues({}, gridState), {
            selections: [{
              startingRowIndex: props.editorState.rowIndex,
              endingRowIndex: props.editorState.rowIndex,
              startingColumnIndex: props.editorState.columnIndex,
              endingColumnIndex: props.editorState.columnIndex
            }]
          });
        });
        ensureCellVisible(
          props.containerRef.current,
          props.scrollAndRenderedContainerRef.current,
          props.currentSheetView,
          props.gridState,
          props.editorState.rowIndex,
          props.editorState.columnIndex
        );
        const fullFormula2 = getFullFormula(
          props.editorState.formula,
          props.editorState.pendingSelections,
          props.sheetData,
          props.editorState.rowIndex
        );
        props.setEditorState(__spreadProps(__spreadValues({}, props.editorState), {
          formula: fullFormula2,
          pendingSelections: void 0
        }));
      }
    };
    const onSubmit = async (e) => {
      e.preventDefault();
      if (selectedSuggestionIndex !== -1 && !endsInReference) {
        takeSuggestion(selectedSuggestionIndex);
        setSavedSelectedSuggestionIndex(-1);
        return;
      }
      const columnID2 = props.sheetData.data[props.editorState.columnIndex].columnID;
      const columnHeader2 = props.sheetData.data[props.editorState.columnIndex].columnHeader;
      const formula = getFullFormula(props.editorState.formula, props.editorState.pendingSelections, props.sheetData, props.editorState.rowIndex);
      const formulaLabel = props.sheetData.index[props.editorState.rowIndex];
      setLoading(true);
      let errorMessage = void 0;
      if (props.editorState.rowIndex == -1) {
        const finalColumnHeader = getColumnHeaderParts(columnHeader2).finalColumnHeader;
        submitRenameColumnHeader(columnHeader2, finalColumnHeader, columnID2, props.sheetIndex, props.editorState, props.setUIState, props.mitoAPI);
      } else {
        const index_labels_formula_is_applied_to = props.editorState.editingMode === "entire_column" ? { "type": "entire_column" } : { "type": "specific_index_labels", "index_labels": [indexLabel] };
        errorMessage = await props.mitoAPI.editSetColumnFormula(
          props.sheetIndex,
          columnID2,
          formulaLabel,
          formula,
          index_labels_formula_is_applied_to,
          props.editorState.editorLocation
        );
      }
      setLoading(false);
      if (isMitoError(errorMessage)) {
        setCellEditorError(errorMessage.to_fix);
      } else {
        closeCellEditor();
        props.closeOpenEditingPopups();
      }
    };
    return /* @__PURE__ */ import_react39.default.createElement("div", { className: "cell-editor" }, /* @__PURE__ */ import_react39.default.createElement(
      "form",
      {
        className: "cell-editor-form",
        onSubmit,
        autoComplete: "off"
      },
      /* @__PURE__ */ import_react39.default.createElement(
        "input",
        {
          ref: setRef,
          id: "cell-editor-input",
          className: "cell-editor-input",
          onClick: () => {
            props.setEditorState(__spreadProps(__spreadValues({}, props.editorState), {
              arrowKeysScrollInFormula: true
            }));
          },
          value: getFullFormula(props.editorState.formula, props.editorState.pendingSelections, props.sheetData, props.editorState.rowIndex),
          onKeyDown,
          onChange: (e) => {
            const CHARS_TO_REMOVE_SCROLL_IN_FORMULA = [
              " ",
              ",",
              "(",
              ")",
              "-",
              "+",
              "*",
              "/",
              "="
            ];
            let arrowKeysScrollInFormula = true;
            if (props.editorState.editorLocation === "cell") {
              const atEndOfFormula = (e.target.selectionStart || 0) >= e.target.value.length;
              const finalChar = e.target.value.substring(e.target.value.length - 1);
              const endsInResetCharacter = atEndOfFormula && CHARS_TO_REMOVE_SCROLL_IN_FORMULA.includes(finalChar);
              const isEmpty = e.target.value.length === 0;
              arrowKeysScrollInFormula = props.editorState.arrowKeysScrollInFormula !== void 0 && !endsInResetCharacter && !isEmpty;
            }
            props.setEditorState(__spreadProps(__spreadValues({}, props.editorState), {
              formula: e.target.value,
              arrowKeysScrollInFormula
            }));
          }
        }
      )
    ), /* @__PURE__ */ import_react39.default.createElement("div", { className: "cell-editor-dropdown-box", style: { width: props.editorState.editorLocation === "cell" ? `${CELL_EDITOR_WIDTH}px` : "300px" } }, cellEditorError === void 0 && props.editorState.rowIndex != -1 && /* @__PURE__ */ import_react39.default.createElement(Row_default, { justify: "space-between", align: "center", className: "cell-editor-label" }, /* @__PURE__ */ import_react39.default.createElement("p", { className: classNames("text-subtext-1", "pl-5px", "mt-2px"), title: props.editorState.editingMode === "entire_column" ? "You are currently editing the entire column. Setting a formula will change all values in the column." : "You are currently editing a specific cell. Changing this value will only effect this cell." }, "Edit entire column"), /* @__PURE__ */ import_react39.default.createElement(
      Toggle_default,
      {
        className: "mr-5px",
        value: props.editorState.editingMode === "entire_column" ? true : false,
        onChange: () => {
          props.setEditorState((prevEditorState) => {
            if (prevEditorState === void 0) {
              return void 0;
            }
            const prevEditingMode = __spreadValues({}, prevEditorState).editingMode;
            return __spreadProps(__spreadValues({}, prevEditorState), {
              editingMode: prevEditingMode === "entire_column" ? "specific_index_labels" : "entire_column"
            });
          });
        },
        height: "20px"
      }
    )), cellEditorError === void 0 && props.editorState.rowIndex == -1 && /* @__PURE__ */ import_react39.default.createElement("p", { className: classNames("text-subtext-1", "pl-5px", "mt-2px"), title: "You are currently editing the column header." }, "Edit column header"), cellEditorError !== void 0 && /* @__PURE__ */ import_react39.default.createElement("div", { className: "cell-editor-error-container pl-10px pr-5px pt-5px pb-5px" }, /* @__PURE__ */ import_react39.default.createElement("p", { className: "text-body-1 text-color-error" }, cellEditorError), /* @__PURE__ */ import_react39.default.createElement("p", { className: "text-subtext-1" }, "Press Escape to close the cell editor.")), loading && /* @__PURE__ */ import_react39.default.createElement("p", { className: "text-body-2 pl-5px" }, "Processing", /* @__PURE__ */ import_react39.default.createElement(LoadingDots_default, null)), cellEditorError === void 0 && !loading && !endsInReference && /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, suggestedColumnHeaders.concat(suggestedFunctions).map(([suggestion, subtext], idx) => {
      if (idx > MAX_SUGGESTIONS) {
        return /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null);
      }
      const selected = idx === selectedSuggestionIndex;
      const suggestionClassNames = classNames("cell-editor-suggestion", "text-body-2", {
        "cell-editor-suggestion-selected": selected
      });
      return /* @__PURE__ */ import_react39.default.createElement(
        "div",
        {
          onMouseEnter: () => setSavedSelectedSuggestionIndex(idx),
          onClick: () => {
            var _a2;
            takeSuggestion(idx);
            (_a2 = cellEditorInputRef.current) == null ? void 0 : _a2.focus();
          },
          className: suggestionClassNames,
          key: suggestion
        },
        /* @__PURE__ */ import_react39.default.createElement("span", { className: "text-overflow-hide", title: suggestion }, suggestion),
        selected && /* @__PURE__ */ import_react39.default.createElement("div", { className: classNames("cell-editor-suggestion-subtext", "text-subtext-1") }, subtext)
      );
    })), cellEditorError === void 0 && !loading && !hasSuggestions && documentationFunction !== void 0 && /* @__PURE__ */ import_react39.default.createElement("div", null, /* @__PURE__ */ import_react39.default.createElement("div", { className: "cell-editor-function-documentation-header pt-5px pb-10px pl-10px pr-10px" }, /* @__PURE__ */ import_react39.default.createElement("p", { className: "text-body-2" }, documentationFunction.syntax), /* @__PURE__ */ import_react39.default.createElement("p", { className: "text-subtext-1" }, documentationFunction.description)), /* @__PURE__ */ import_react39.default.createElement("div", { className: "pt-5px pb-10px pr-10px pl-10px" }, /* @__PURE__ */ import_react39.default.createElement("p", { className: "text-subtext-1" }, "Examples"), (_a = documentationFunction.examples) == null ? void 0 : _a.map((example, index) => {
      return /* @__PURE__ */ import_react39.default.createElement(
        "p",
        {
          key: index,
          className: "cell-editor-function-documentation-example"
        },
        example
      );
    })))));
  };
  var CellEditor_default = CellEditor;

  // src/components/endo/FormulaBar.tsx
  var FormulaBar = (props) => {
    var _a, _b;
    const rowIndex = props.selection.startingRowIndex;
    const colIndex = props.selection.startingColumnIndex;
    const { columnHeader, columnFormula, cellValue, columnFormulaLocation } = getCellDataFromCellIndexes(props.sheetData, rowIndex, colIndex);
    const originalFormulaBarValue = "" + (columnFormula !== void 0 && columnFormula !== "" ? columnFormula : cellValue !== void 0 ? cellValue : "");
    const cellEditingCellData = props.editorState === void 0 ? void 0 : getCellDataFromCellIndexes(props.sheetData, props.editorState.rowIndex, props.editorState.columnIndex);
    const formulaBarColumnHeader = props.editorState === void 0 ? columnHeader : cellEditingCellData == null ? void 0 : cellEditingCellData.columnHeader;
    let formulaBarValue = "";
    if (props.editorState === void 0) {
      if (rowIndex == -1 && columnHeader !== void 0) {
        formulaBarValue = getDisplayColumnHeader(columnHeader);
      } else {
        formulaBarValue = originalFormulaBarValue;
      }
    } else {
      formulaBarValue = getFullFormula(props.editorState.formula, props.editorState.pendingSelections, props.sheetData, props.editorState.rowIndex);
    }
    const currentSheetView = calculateCurrentSheetView(props.gridState);
    return /* @__PURE__ */ import_react40.default.createElement(
      Row_default,
      {
        align: "center",
        style: {
          borderTop: "1px solid var(--mito-border)",
          borderBottom: "1px solid var(--mito-border)",
          background: "white"
        },
        suppressTopBottomMargin: true
      },
      /* @__PURE__ */ import_react40.default.createElement(Col_default, { offset: 0.5 }, /* @__PURE__ */ import_react40.default.createElement("p", { className: "formula-bar-column-header text-header-3 text-overflow-hide" }, formulaBarColumnHeader)),
      /* @__PURE__ */ import_react40.default.createElement(Col_default, null, /* @__PURE__ */ import_react40.default.createElement("div", { className: "formula-bar-vertical-line" })),
      /* @__PURE__ */ import_react40.default.createElement(Col_default, { flex: "1" }, ((_a = props.editorState) == null ? void 0 : _a.editorLocation) === "formula bar" && /* @__PURE__ */ import_react40.default.createElement(
        CellEditor_default,
        {
          sheetData: props.sheetData,
          sheetIndex: props.sheetIndex,
          gridState: props.gridState,
          editorState: props.editorState,
          setEditorState: props.setEditorState,
          setGridState: props.setGridState,
          setUIState: props.setUIState,
          scrollAndRenderedContainerRef: props.scrollAndRenderedContainerRef,
          containerRef: props.containerRef,
          mitoAPI: props.mitoAPI,
          currentSheetView,
          closeOpenEditingPopups: props.closeOpenEditingPopups
        }
      ), ((_b = props.editorState) == null ? void 0 : _b.editorLocation) !== "formula bar" && /* @__PURE__ */ import_react40.default.createElement(
        "div",
        {
          className: "formula-bar-formula text-header-3 text-overflow-hide element-width-block",
          onDoubleClick: () => {
            props.setEditorState({
              rowIndex,
              columnIndex: colIndex,
              formula: formulaBarValue,
              arrowKeysScrollInFormula: true,
              editorLocation: "formula bar",
              editingMode: columnFormulaLocation || "entire_column"
            });
          }
        },
        formulaBarValue
      ))
    );
  };
  var FormulaBar_default = FormulaBar;

  // src/components/endo/ColumnHeaders.tsx
  var import_react41 = __toESM(require_react());
  var ColumnHeaders = (props) => {
    const columnHeadersContainerRef = (0, import_react41.useRef)(null);
    const [columnHeaderOperation, setColumnHeaderOperation] = (0, import_react41.useState)(void 0);
    const [scrollAmount, setScrollAmount] = (0, import_react41.useState)(void 0);
    (0, import_react41.useEffect)(() => {
      if (scrollAmount !== void 0) {
        const interval = setInterval(() => {
          var _a;
          (_a = props.scrollAndRenderedContainerRef.current) == null ? void 0 : _a.scrollBy(
            {
              left: scrollAmount
            }
          );
        }, 10);
        return () => {
          clearInterval(interval);
        };
      }
    }, [props.scrollAndRenderedContainerRef, scrollAmount]);
    const currentSheetView = calculateCurrentSheetView(props.gridState);
    const translate = calculateTranslate(props.gridState);
    const columnHeaderStyle = { transform: `translateX(${-translate.x}px)` };
    return /* @__PURE__ */ import_react41.default.createElement(import_react41.default.Fragment, null, props.sheetData.numColumns > 0 && /* @__PURE__ */ import_react41.default.createElement(
      "div",
      {
        className: classNames("column-headers-container", {
          "column-headers-no-operation": columnHeaderOperation === void 0,
          "column-headers-resizing": columnHeaderOperation === "resize"
        }),
        ref: columnHeadersContainerRef,
        onDragOver: (e) => {
          var _a, _b, _c;
          e.preventDefault();
          e.persist();
          const leftInHeader = e.clientX - (((_a = columnHeadersContainerRef.current) == null ? void 0 : _a.getBoundingClientRect().left) || 0);
          if (leftInHeader < 100) {
            const offsetScale = 1 - leftInHeader / 100;
            setScrollAmount(-25 * offsetScale);
          } else if (leftInHeader > (((_b = columnHeadersContainerRef.current) == null ? void 0 : _b.getBoundingClientRect().width) || 0) - 100) {
            const offsetScale = 1 - ((((_c = columnHeadersContainerRef.current) == null ? void 0 : _c.getBoundingClientRect().width) || 0) - leftInHeader) / 100;
            setScrollAmount(25 * offsetScale);
          } else {
            setScrollAmount(void 0);
          }
        },
        onDrop: (e) => {
          e.preventDefault();
          setScrollAmount(void 0);
          const clientX = e.clientX;
          const clientY = e.clientY;
          const operation = e.dataTransfer.getData("operation");
          const columnIndexString = e.dataTransfer.getData("mito-col-index");
          if (operation === "" || columnIndexString === "") {
            return;
          }
          const dragColumnIndex = parseInt(columnIndexString);
          if (operation === "resize") {
            const columnHeaderDivs = getChildrenWithQuery(props.containerRef.current, `.column-header-container[mito-col-index="${dragColumnIndex}"]`);
            if (columnHeaderDivs.length === 0) {
              return;
            }
            const columnHeaderDiv = columnHeaderDivs[0];
            const newWidth = Math.max(e.clientX - columnHeaderDiv.getBoundingClientRect().left, MIN_WIDTH);
            props.setGridState((gridState) => {
              return __spreadProps(__spreadValues({}, gridState), {
                widthDataArray: changeColumnWidthDataArray(props.sheetIndex, props.gridState.widthDataArray, dragColumnIndex, newWidth)
              });
            });
          } else if (operation === "reorder") {
            const startingColumnIndex = dragColumnIndex;
            const { columnIndex } = getIndexesFromXAndY(clientX, clientY);
            const columnIDToReorder = props.sheetData.data[startingColumnIndex].columnID;
            if (dragColumnIndex === columnIndex) {
              return;
            }
            if (columnIndex === void 0 || columnIDToReorder === void 0) {
              return;
            }
            void props.mitoAPI.editReorderColumn(props.sheetIndex, columnIDToReorder, columnIndex);
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: { type: "none" /* NONE */ }
              });
            });
            props.setGridState((gridState) => {
              return __spreadProps(__spreadValues({}, gridState), {
                selection: __spreadProps(__spreadValues({}, gridState.selections), {
                  startingColumnIndex: columnIndex,
                  endingColumnIndex: columnIndex
                })
              });
            });
          }
        },
        onMouseLeave: () => {
          setScrollAmount(void 0);
        },
        onMouseUp: () => {
          setScrollAmount(void 0);
        }
      },
      /* @__PURE__ */ import_react41.default.createElement("div", { style: columnHeaderStyle }, Array(currentSheetView.numColumnsRendered).fill(0).map((_, _colIndex) => {
        const columnIndex = currentSheetView.startingColumnIndex + _colIndex;
        return /* @__PURE__ */ import_react41.default.createElement(
          ColumnHeader_default,
          {
            key: columnIndex,
            columnIndex,
            sheetData: props.sheetData,
            gridState: props.gridState,
            setGridState: props.setGridState,
            editorState: props.editorState,
            setEditorState: props.setEditorState,
            containerRef: props.containerRef,
            columnHeaderOperation,
            setColumnHeaderOperation,
            setUIState: props.setUIState,
            mitoAPI: props.mitoAPI,
            closeOpenEditingPopups: props.closeOpenEditingPopups
          }
        );
      }))
    ));
  };
  var ColumnHeaders_default = import_react41.default.memo(ColumnHeaders);

  // src/components/endo/EmptyGridMessages.tsx
  var import_react42 = __toESM(require_react());
  var GridDataEmptyContainer = (props) => {
    return /* @__PURE__ */ import_react42.default.createElement("div", { className: "endo-grid-empty-container" }, /* @__PURE__ */ import_react42.default.createElement("div", { className: "endo-grid-empty-text-container" }, props.children));
  };
  var EmptyGridMessages = (props) => {
    return /* @__PURE__ */ import_react42.default.createElement(import_react42.default.Fragment, null, props.sheetData === void 0 && /* @__PURE__ */ import_react42.default.createElement(GridDataEmptyContainer, null, /* @__PURE__ */ import_react42.default.createElement("div", null, /* @__PURE__ */ import_react42.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "medium",
        onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "import files" /* IMPORT_FILES */ }
            });
          });
          void props.mitoAPI.log("clicked_empty_grid_import_button");
        },
        disabled: props.uiState.currOpenTaskpane.type === "import files" /* IMPORT_FILES */ || props.uiState.currOpenTaskpane.type === "Excel Range Import" /* EXCEL_RANGE_IMPORT */ || props.uiState.currOpenTaskpane.type === "UpdateImports" /* UPDATEIMPORTS */ && props.uiState.currOpenTaskpane.failedReplayData !== void 0 || props.commCreationStatus !== "finished"
      },
      "Import Files"
    )), /* @__PURE__ */ import_react42.default.createElement("p", { className: "mt-5px text-body-1", style: { textAlign: "center" } }, "Or import dfs using the syntax ", /* @__PURE__ */ import_react42.default.createElement("code", null, "mitosheet.sheet(df1, df2)"), " in the code above.")), props.sheetData !== void 0 && props.sheetData.numRows === 0 && props.sheetData.numColumns === 0 && /* @__PURE__ */ import_react42.default.createElement(GridDataEmptyContainer, null, /* @__PURE__ */ import_react42.default.createElement("p", { className: "text-body-1", style: { textAlign: "center" } }, "No data in dataframe.")), props.sheetData !== void 0 && props.sheetData.numRows > 0 && props.sheetData.numColumns === 0 && /* @__PURE__ */ import_react42.default.createElement(GridDataEmptyContainer, null, /* @__PURE__ */ import_react42.default.createElement("p", { className: "text-body-1", style: { textAlign: "center" } }, "No columns in dataframe.")), props.sheetData !== void 0 && props.sheetData.numRows === 0 && props.sheetData.numColumns > 0 && /* @__PURE__ */ import_react42.default.createElement(GridDataEmptyContainer, null, /* @__PURE__ */ import_react42.default.createElement("p", { className: "text-body-1", style: { textAlign: "center" } }, "No rows in dataframe.")));
  };
  var EmptyGridMessages_default = EmptyGridMessages;

  // src/components/endo/GridData.tsx
  var import_react45 = __toESM(require_react());

  // src/utils/format.tsx
  var import_react44 = __toESM(require_react());

  // src/components/icons/DropdownCheckmark.tsx
  var import_react43 = __toESM(require_react());
  var DropdownCheckmark = () => {
    return /* @__PURE__ */ import_react43.default.createElement("svg", { width: "12", height: "14", viewBox: "0 0 12 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react43.default.createElement("path", { d: "M10.0608 0.805159C10.2802 0.402958 10.8246 0.324565 11.1485 0.64852V0.64852C11.3582 0.858224 11.4095 1.17891 11.2756 1.44354L5.57867 12.705C5.26247 13.3301 4.41824 13.4447 3.94677 12.9267L0.628074 9.28008C0.18803 8.79655 0.522012 8.01982 1.17566 8.00657V8.00657C1.38287 8.00237 1.58284 8.08284 1.72939 8.22939L3.55497 10.055C4.02704 10.527 4.82029 10.4128 5.13997 9.82672L10.0608 0.805159Z", fill: "#494650" }));
  };
  var DropdownCheckmark_default = DropdownCheckmark;

  // src/utils/format.tsx
  var FORMAT_DISABLED_MESSAGE = "You must have at least one number column selected to adjust the formatting.";
  var formatNumber = (number, precision) => {
    return number.toLocaleString("en-US", { minimumFractionDigits: precision, maximumFractionDigits: precision });
  };
  var formatCellData = (cellData, columnDtype, columnFormat) => {
    if (typeof cellData !== "number") {
      return "" + cellData;
    }
    const type = columnFormat == null ? void 0 : columnFormat.type;
    let precision = columnFormat == null ? void 0 : columnFormat.precision;
    if (precision === void 0) {
      if (isFloatDtype(columnDtype)) {
        precision = 2;
      }
      if (isIntDtype(columnDtype)) {
        precision = 0;
      }
    }
    if ((precision || 0) > 20) {
      precision = 20;
    }
    switch (type) {
      case void 0: {
        return formatNumber(cellData, precision);
      }
      case "plain text" /* PLAIN_TEXT */:
        return formatNumber(cellData, precision).replace(/,/g, "");
      case "percentage" /* PERCENTAGE */:
        return cellData.toLocaleString("en-US", { style: "percent", minimumFractionDigits: precision, maximumFractionDigits: precision });
      case "currency" /* CURRENCY */:
        return cellData.toLocaleString("en-US", { style: "currency", currency: "USD", minimumFractionDigits: precision, maximumFractionDigits: precision });
      case "accounting" /* ACCOUNTING */:
        return cellData.toLocaleString("en-US", { style: "currency", currency: "USD", currencySign: "accounting", minimumFractionDigits: precision, maximumFractionDigits: precision });
      case "scientific notation" /* SCIENTIFIC_NOTATION */:
        return cellData.toExponential(precision);
    }
  };
  var increasePrecision = (columnFormat, columnDtype) => {
    if (columnDtype && isFloatDtype(columnDtype) && columnFormat.precision === void 0) {
      return __spreadProps(__spreadValues({}, columnFormat), { precision: 3 });
    } else {
      return __spreadProps(__spreadValues({}, columnFormat), { precision: (columnFormat.precision || 0) + 1 });
    }
  };
  var decreasePrecision = (columnFormat, columnDtype) => {
    if (columnDtype && isFloatDtype(columnDtype) && columnFormat.precision === void 0) {
      return __spreadProps(__spreadValues({}, columnFormat), { precision: 1 });
    } else {
      return __spreadProps(__spreadValues({}, columnFormat), { precision: Math.max((columnFormat.precision || 0) - 1, 0) });
    }
  };
  var changeFormatOfColumns = async (sheetIndex, sheetData, columnIDs, newColumnFormat, mitoAPI) => {
    const newDfFormat = __spreadValues({}, (sheetData == null ? void 0 : sheetData.dfFormat) || getDefaultDataframeFormat());
    columnIDs.forEach((columnID) => {
      if (newColumnFormat === void 0) {
        newDfFormat.columns[columnID] = newColumnFormat;
      } else {
        const existingColumnFormat = newDfFormat.columns[columnID] || {};
        newDfFormat.columns[columnID] = __spreadValues(__spreadValues({}, existingColumnFormat), newColumnFormat);
      }
    });
    await mitoAPI.editSetDataframeFormat(
      sheetIndex,
      newDfFormat
    );
  };
  var getColumnFormatDropdownItems = (sheetIndex, sheetData, columnIDs, mitoAPI) => {
    const numberColumnColumnIDs = getNumberColumnIDs(sheetData, columnIDs);
    const appliedFormatting = sheetData == null ? void 0 : sheetData.dfFormat.columns[numberColumnColumnIDs[0]];
    const onClick = (columnFormat) => {
      void changeFormatOfColumns(
        sheetIndex,
        sheetData,
        columnIDs,
        columnFormat,
        mitoAPI
      );
    };
    return _getColumnFormatDropdownItems(onClick, numberColumnColumnIDs.length === 0, appliedFormatting);
  };
  var _getColumnFormatDropdownItems = (onClick, disabled, appliedColumnFormat) => {
    return [
      /* @__PURE__ */ import_react44.default.createElement(
        DropdownItem_default,
        {
          key: "Default",
          title: "Default",
          icon: (appliedColumnFormat == null ? void 0 : appliedColumnFormat.type) === void 0 ? /* @__PURE__ */ import_react44.default.createElement(DropdownCheckmark_default, null) : void 0,
          onClick: () => onClick({ type: void 0 }),
          rightText: "1,234.6",
          disabled
        }
      ),
      /* @__PURE__ */ import_react44.default.createElement(
        DropdownItem_default,
        {
          key: getFormatTitle({ type: "plain text" /* PLAIN_TEXT */ }),
          title: getFormatTitle({ type: "plain text" /* PLAIN_TEXT */ }),
          icon: (appliedColumnFormat == null ? void 0 : appliedColumnFormat.type) === "plain text" /* PLAIN_TEXT */ ? /* @__PURE__ */ import_react44.default.createElement(DropdownCheckmark_default, null) : void 0,
          onClick: () => onClick({ type: "plain text" /* PLAIN_TEXT */ }),
          rightText: "1234.6",
          disabled
        }
      ),
      /* @__PURE__ */ import_react44.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true, key: "sep" }),
      /* @__PURE__ */ import_react44.default.createElement(
        DropdownItem_default,
        {
          key: getFormatTitle({ type: "currency" /* CURRENCY */ }),
          title: getFormatTitle({ type: "currency" /* CURRENCY */ }),
          icon: (appliedColumnFormat == null ? void 0 : appliedColumnFormat.type) === "currency" /* CURRENCY */ ? /* @__PURE__ */ import_react44.default.createElement(DropdownCheckmark_default, null) : void 0,
          onClick: () => onClick({ type: "currency" /* CURRENCY */ }),
          rightText: "$-1,234.57",
          disabled
        }
      ),
      /* @__PURE__ */ import_react44.default.createElement(
        DropdownItem_default,
        {
          key: getFormatTitle({ type: "accounting" /* ACCOUNTING */ }),
          title: getFormatTitle({ type: "accounting" /* ACCOUNTING */ }),
          icon: (appliedColumnFormat == null ? void 0 : appliedColumnFormat.type) === "accounting" /* ACCOUNTING */ ? /* @__PURE__ */ import_react44.default.createElement(DropdownCheckmark_default, null) : void 0,
          onClick: () => onClick({ type: "accounting" /* ACCOUNTING */ }),
          rightText: "($1,234.57)",
          disabled
        }
      ),
      /* @__PURE__ */ import_react44.default.createElement(
        DropdownItem_default,
        {
          key: getFormatTitle({ type: "percentage" /* PERCENTAGE */ }),
          title: getFormatTitle({ type: "percentage" /* PERCENTAGE */ }),
          icon: (appliedColumnFormat == null ? void 0 : appliedColumnFormat.type) === "percentage" /* PERCENTAGE */ ? /* @__PURE__ */ import_react44.default.createElement(DropdownCheckmark_default, null) : void 0,
          onClick: () => onClick({ type: "percentage" /* PERCENTAGE */ }),
          rightText: "123,457.00%",
          disabled
        }
      ),
      /* @__PURE__ */ import_react44.default.createElement(
        DropdownItem_default,
        {
          key: getFormatTitle({ type: "scientific notation" /* SCIENTIFIC_NOTATION */ }),
          title: getFormatTitle({ type: "scientific notation" /* SCIENTIFIC_NOTATION */ }),
          icon: (appliedColumnFormat == null ? void 0 : appliedColumnFormat.type) === "scientific notation" /* SCIENTIFIC_NOTATION */ ? /* @__PURE__ */ import_react44.default.createElement(DropdownCheckmark_default, null) : void 0,
          onClick: () => onClick({ type: "scientific notation" /* SCIENTIFIC_NOTATION */ }),
          rightText: "1.23e+3",
          disabled
        }
      )
    ];
  };
  var getFormatTitle = (formatTypeObj) => {
    if (formatTypeObj === void 0) {
      return "Default";
    }
    switch (formatTypeObj.type) {
      case void 0:
        return "Default";
      case "plain text" /* PLAIN_TEXT */:
        return "Plain Text";
      case "percentage" /* PERCENTAGE */: {
        return "Percentage";
      }
      case "currency" /* CURRENCY */: {
        return "Currency";
      }
      case "accounting" /* ACCOUNTING */: {
        return "Accounting";
      }
      case "scientific notation" /* SCIENTIFIC_NOTATION */:
        return "Scientific Notation";
    }
  };

  // src/components/endo/GridData.tsx
  var EVEN_ROW_BACKGROUND_COLOR_DEFAULT = "#F5F5F5";
  var ODD_ROW_BACKGROUND_COLOR_DEFAULT = "#FFFFFF";
  var EVEN_ROW_TEXT_COLOR_DEFAULT = "#494650";
  var ODD_ROW_TEXT_COLOR_DEFAULT = "#494650";
  var GridData = (props) => {
    var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
    const currentSheetView = calculateCurrentSheetView(props.gridState);
    const sheetData = props.sheetData;
    const evenRowBackgroundColor = ((_c = (_b = (_a = sheetData == null ? void 0 : sheetData.dfFormat) == null ? void 0 : _a.rows) == null ? void 0 : _b.even) == null ? void 0 : _c.backgroundColor) || EVEN_ROW_BACKGROUND_COLOR_DEFAULT;
    const oddRowBackgroundColor = ((_f = (_e = (_d = sheetData == null ? void 0 : sheetData.dfFormat) == null ? void 0 : _d.rows) == null ? void 0 : _e.odd) == null ? void 0 : _f.backgroundColor) || ODD_ROW_BACKGROUND_COLOR_DEFAULT;
    const evenRowTextColor = ((_i = (_h = (_g = sheetData == null ? void 0 : sheetData.dfFormat) == null ? void 0 : _g.rows) == null ? void 0 : _h.even) == null ? void 0 : _i.color) || EVEN_ROW_TEXT_COLOR_DEFAULT;
    const oddRowTextColor = ((_l = (_k = (_j = sheetData == null ? void 0 : sheetData.dfFormat) == null ? void 0 : _j.rows) == null ? void 0 : _k.odd) == null ? void 0 : _l.color) || ODD_ROW_TEXT_COLOR_DEFAULT;
    return /* @__PURE__ */ import_react45.default.createElement(import_react45.default.Fragment, null, sheetData && sheetData.numRows > 0 && Array(currentSheetView.numRowsRendered).fill(0).map((_, _rowIndex) => {
      const rowIndex = currentSheetView.startingRowIndex + _rowIndex;
      const columnIDs = getColumnIDsArrayFromSheetDataArray([sheetData])[0];
      const rowClassNames = classNames("mito-grid-row", {
        "mito-grid-row-even": rowIndex % 2 === 0,
        "mito-grid-row-odd": rowIndex % 2 !== 0
      });
      const style2 = rowIndex % 2 === 0 ? { backgroundColor: evenRowBackgroundColor, color: evenRowTextColor } : { backgroundColor: oddRowBackgroundColor, color: oddRowTextColor };
      return /* @__PURE__ */ import_react45.default.createElement("div", { className: rowClassNames, key: rowIndex, style: style2 }, Array(currentSheetView.numColumnsRendered).fill(0).map((_2, _colIndex) => {
        var _a2, _b2, _c2, _d2, _e2, _f2;
        const columnIndex = currentSheetView.startingColumnIndex + _colIndex;
        const columnID = columnIDs[columnIndex];
        const columnDtype = (_b2 = (_a2 = props.sheetData) == null ? void 0 : _a2.data[columnIndex]) == null ? void 0 : _b2.columnDtype;
        const index = ((_c2 = props.sheetData) == null ? void 0 : _c2.index[rowIndex]) !== void 0 ? (_d2 = props.sheetData) == null ? void 0 : _d2.index[rowIndex] : 0;
        const columnFormatType = sheetData.dfFormat.columns[columnID];
        const cellData = (_f2 = (_e2 = props.sheetData) == null ? void 0 : _e2.data[columnIndex]) == null ? void 0 : _f2.columnData[rowIndex];
        const cellIsSelected = getIsCellSelected(props.gridState.selections, rowIndex, columnIndex);
        const conditionalFormatMap = sheetData == null ? void 0 : sheetData.conditionalFormattingResult.results[columnID];
        const conditionalFormat = conditionalFormatMap ? __spreadValues({}, conditionalFormatMap[index]) : void 0;
        if (cellIsSelected && (conditionalFormat == null ? void 0 : conditionalFormat.backgroundColor) !== void 0 && (conditionalFormat == null ? void 0 : conditionalFormat.backgroundColor) !== null) {
          conditionalFormat.backgroundColor = hexToRGB(conditionalFormat.backgroundColor, 0.4);
        }
        if (cellData === void 0 || columnDtype == void 0) {
          return null;
        }
        const className = classNames("mito-grid-cell", "text-unselectable", {
          "mito-grid-cell-selected": cellIsSelected,
          "mito-grid-cell-conditional-format-background-color": (conditionalFormat == null ? void 0 : conditionalFormat.backgroundColor) !== void 0,
          "mito-grid-cell-hidden": props.editorState !== void 0 && props.editorState.rowIndex === rowIndex && props.editorState.columnIndex === columnIndex,
          "right-align-number-series": isNumberDtype(columnDtype)
        });
        const cellWidth = props.gridState.widthDataArray[props.gridState.sheetIndex].widthArray[columnIndex];
        const displayCellData = formatCellData(cellData, columnDtype, columnFormatType);
        return /* @__PURE__ */ import_react45.default.createElement(
          "div",
          {
            className,
            key: columnIndex,
            style: __spreadValues(__spreadValues({
              width: `${cellWidth}px`
            }, getBorderStyle(props.gridState.selections, props.gridState.copiedSelections, rowIndex, columnIndex, sheetData.numRows)), conditionalFormat || {}),
            tabIndex: -1,
            "mito-col-index": columnIndex,
            "mito-row-index": rowIndex,
            title: displayCellData
          },
          displayCellData
        );
      }));
    }));
  };
  var GridData_default = import_react45.default.memo(GridData);

  // src/components/endo/IndexHeaders.tsx
  var import_react47 = __toESM(require_react());

  // src/components/endo/IndexHeaderDropdown.tsx
  var import_react46 = __toESM(require_react());
  function IndexHeaderDropdown(props) {
    (0, import_react46.useEffect)(() => {
      if (props.display) {
        void props.mitoAPI.log("opened_index_header_dropdown");
      }
    }, [props.display]);
    return /* @__PURE__ */ import_react46.default.createElement(
      Dropdown_default,
      {
        display: props.display,
        closeDropdown: () => props.setOpenIndexHeaderDropdown(void 0),
        width: "medium"
      },
      /* @__PURE__ */ import_react46.default.createElement(
        DropdownItem_default,
        {
          title: "Delete Rows",
          onClick: () => {
            void props.mitoAPI.editDeleteRow(props.sheetIndex, getSelectedRowLabelsWithEntireSelectedRow(props.selections, props.sheetData));
          }
        }
      ),
      /* @__PURE__ */ import_react46.default.createElement(
        DropdownItem_default,
        {
          title: "Promote Row to Header",
          onClick: () => {
            void props.mitoAPI.editPromoteRowToHeader(props.sheetIndex, props.index);
          }
        }
      ),
      /* @__PURE__ */ import_react46.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ import_react46.default.createElement(
        DropdownItem_default,
        {
          title: "Reset and Drop Index",
          onClick: () => {
            void props.mitoAPI.editResetIndex(props.sheetIndex, true);
          }
        }
      ),
      /* @__PURE__ */ import_react46.default.createElement(
        DropdownItem_default,
        {
          title: "Reset Index",
          onClick: () => {
            void props.mitoAPI.editResetIndex(props.sheetIndex, false);
          }
        }
      )
    );
  }

  // src/components/endo/IndexHeaders.tsx
  var IndexHeaders = (props) => {
    const [openIndexHeaderDropdown, setOpenIndexHeaderDropdown] = (0, import_react47.useState)(void 0);
    const currentSheetView = calculateCurrentSheetView(props.gridState);
    const translate = calculateTranslate(props.gridState);
    const indexHeadersStyle = {
      transform: `translateY(${-translate.y}px)`
    };
    return /* @__PURE__ */ import_react47.default.createElement(import_react47.default.Fragment, null, /* @__PURE__ */ import_react47.default.createElement("div", { className: "index-headers-container" }, props.sheetData.numRows > 0 && /* @__PURE__ */ import_react47.default.createElement("div", { style: indexHeadersStyle }, Array(currentSheetView.numRowsRendered).fill(0).map((_, _rowIndex) => {
      const rowIndex = currentSheetView.startingRowIndex + _rowIndex;
      const selected = getIsCellSelected(
        props.gridState.selections,
        rowIndex,
        -1
      );
      const className = classNames("index-header-container", "text-overflow-hide", "text-unselectable", { "index-header-selected": selected });
      const indexHeader = rowIndex >= props.sheetData.numRows ? "" : props.sheetData.index[rowIndex];
      return /* @__PURE__ */ import_react47.default.createElement(
        "div",
        {
          className,
          key: rowIndex,
          title: indexHeader + "",
          tabIndex: -1,
          "mito-row-index": rowIndex,
          "mito-col-index": -1,
          style: __spreadValues({}, getBorderStyle(props.gridState.selections, props.gridState.copiedSelections, rowIndex, -1, props.sheetData.numRows)),
          onContextMenu: (e) => {
            e.preventDefault();
            e.stopPropagation();
            setOpenIndexHeaderDropdown(rowIndex);
          }
        },
        indexHeader,
        /* @__PURE__ */ import_react47.default.createElement(
          IndexHeaderDropdown,
          {
            sheetData: props.sheetData,
            setOpenIndexHeaderDropdown,
            display: openIndexHeaderDropdown === rowIndex,
            index: indexHeader,
            mitoAPI: props.mitoAPI,
            sheetIndex: props.sheetIndex,
            selections: props.gridState.selections,
            closeOpenEditingPopups: props.closeOpenEditingPopups
          }
        )
      );
    }))));
  };
  var IndexHeaders_default = import_react47.default.memo(IndexHeaders);

  // src/components/endo/celleditor/FloatingCellEditor.tsx
  var import_react48 = __toESM(require_react());
  var FloatingCellEditor = (props) => {
    const [editorStyle, setEditorStyle] = (0, import_react48.useState)({
      top: 0,
      left: 0,
      display: "none"
    });
    const currentSheetView = calculateCurrentSheetView(props.gridState);
    const { columnID, columnHeader } = getCellDataFromCellIndexes(props.sheetData, props.editorState.rowIndex, props.editorState.columnIndex);
    (0, import_react48.useEffect)(() => {
      const updateCellEditorPosition = () => {
        var _a;
        const scrollAndRenderedContainerRect = (_a = props.scrollAndRenderedContainerRef.current) == null ? void 0 : _a.getBoundingClientRect();
        if (scrollAndRenderedContainerRect === void 0) {
          return;
        }
        const cellInRow = getCellInRow(props.scrollAndRenderedContainerRef.current, props.editorState.rowIndex);
        const cellInRowRect = cellInRow == null ? void 0 : cellInRow.getBoundingClientRect();
        const cellInColumn = getCellInColumn(props.scrollAndRenderedContainerRef.current, props.editorState.columnIndex);
        const cellInColumnRect = cellInColumn == null ? void 0 : cellInColumn.getBoundingClientRect();
        let top = void 0;
        let left = void 0;
        let bottom = void 0;
        let right = void 0;
        const columnHeadersHeight = columnHeader === void 0 || isPrimitiveColumnHeader(columnHeader) ? 45 : 45 + (columnHeader.length - 1) * 25;
        const defaultTop = cellInRowRect ? cellInRowRect.y : props.editorState.rowIndex < currentSheetView.startingRowIndex ? 0 : scrollAndRenderedContainerRect.y * 100;
        top = Math.min(Math.max(0, defaultTop - scrollAndRenderedContainerRect.y + 4) + columnHeadersHeight, scrollAndRenderedContainerRect.height);
        if (top >= scrollAndRenderedContainerRect.height - 50) {
          top = void 0;
          bottom = 0;
        }
        const defaultLeft = cellInColumnRect ? cellInColumnRect.x : props.editorState.columnIndex < currentSheetView.startingColumnIndex ? 0 : scrollAndRenderedContainerRect.x * 100;
        left = Math.min(Math.max(0, defaultLeft - scrollAndRenderedContainerRect.x) + 80, scrollAndRenderedContainerRect.width);
        if (left + CELL_EDITOR_WIDTH >= scrollAndRenderedContainerRect.width) {
          left = void 0;
          right = 0;
        }
        if (top === editorStyle.top && left === editorStyle.left && bottom === editorStyle.bottom && right === editorStyle.right) {
          return;
        }
        setEditorStyle({
          top,
          left,
          bottom,
          right,
          display: void 0
        });
      };
      setTimeout(updateCellEditorPosition);
      fscreen_esm_default.addEventListener("fullscreenchange", updateCellEditorPosition);
      return () => fscreen_esm_default.removeEventListener("fullscreenchange", updateCellEditorPosition);
    }, []);
    if (columnID === void 0 || columnHeader === void 0) {
      return /* @__PURE__ */ import_react48.default.createElement(import_react48.default.Fragment, null);
    }
    return /* @__PURE__ */ import_react48.default.createElement(
      "div",
      {
        className: "floating-cell-editor",
        style: __spreadProps(__spreadValues({}, editorStyle), {
          width: `${CELL_EDITOR_WIDTH}px`
        })
      },
      /* @__PURE__ */ import_react48.default.createElement(
        CellEditor_default,
        {
          sheetData: props.sheetData,
          sheetIndex: props.sheetIndex,
          gridState: props.gridState,
          editorState: props.editorState,
          setEditorState: props.setEditorState,
          setGridState: props.setGridState,
          setUIState: props.setUIState,
          scrollAndRenderedContainerRef: props.scrollAndRenderedContainerRef,
          containerRef: props.containerRef,
          mitoAPI: props.mitoAPI,
          currentSheetView,
          closeOpenEditingPopups: props.closeOpenEditingPopups
        }
      )
    );
  };
  var FloatingCellEditor_default = FloatingCellEditor;

  // src/components/endo/EndoGrid.tsx
  var DEFAULT_WIDTH = 123;
  var DEFAULT_HEIGHT = 25;
  var MIN_WIDTH = 50;
  var MAX_ROWS = 1500;
  var KEYS_TO_IGNORE_IF_PRESSED_ALONE = [
    "Shift",
    "Meta",
    "Alt",
    "Control",
    "CapsLock",
    "NumLock",
    "PageUp",
    "PageDown",
    "Unidentified"
  ];
  var KEYBOARD_SHORTCUTS_TO_IGNORE_WITH_CONTROL = [
    "c",
    "z",
    "y"
  ];
  function EndoGrid(props) {
    var _a;
    const containerRef = (0, import_react49.useRef)(null);
    const scrollAndRenderedContainerRef = (0, import_react49.useRef)(null);
    const [mouseDown, setMouseDown] = (0, import_react49.useState)(false);
    const [resizeObserver] = (0, import_react49.useState)(() => new ResizeObserver(() => {
      resizeViewport();
    }));
    const {
      sheetDataArray: sheetDataArray2,
      sheetIndex,
      gridState,
      setGridState,
      editorState,
      setEditorState,
      uiState,
      setUIState,
      mitoAPI
    } = props;
    const sheetData = sheetDataArray2[sheetIndex];
    const totalSize = {
      width: ((_a = gridState.widthDataArray[gridState.sheetIndex]) == null ? void 0 : _a.totalWidth) || 0,
      height: DEFAULT_HEIGHT * Math.min((sheetData == null ? void 0 : sheetData.numRows) || 0, MAX_ROWS)
    };
    const currentSheetView = (0, import_react49.useMemo)(() => {
      return calculateCurrentSheetView(gridState);
    }, [gridState]);
    const translate = (0, import_react49.useMemo)(() => {
      return calculateTranslate(gridState);
    }, [gridState]);
    (0, import_react49.useEffect)(() => {
      setGridState((gridState2) => {
        return __spreadProps(__spreadValues({}, gridState2), {
          selections: reconciliateSelections(gridState2.sheetIndex, sheetIndex, gridState2.selections, gridState2.columnIDsArray[gridState2.sheetIndex], sheetData),
          widthDataArray: reconciliateWidthDataArray(gridState2.widthDataArray, gridState2.columnIDsArray, sheetDataArray2),
          columnIDsArray: getColumnIDsArrayFromSheetDataArray(sheetDataArray2),
          sheetIndex,
          copiedSelections: []
        });
      });
    }, [sheetData, setGridState, sheetIndex]);
    const resizeViewport = () => {
      setGridState((gridState2) => {
        const scrollAndRenderedContainerDiv = scrollAndRenderedContainerRef == null ? void 0 : scrollAndRenderedContainerRef.current;
        if (scrollAndRenderedContainerDiv) {
          const newViewport = {
            width: scrollAndRenderedContainerDiv.clientWidth,
            height: scrollAndRenderedContainerDiv.clientHeight
          };
          return __spreadProps(__spreadValues({}, gridState2), {
            viewport: newViewport
          });
        }
        return gridState2;
      });
    };
    const setScrollAndRendererContainerRef = (0, import_react49.useCallback)((unsavedScrollAndRenderedContainerDiv) => {
      if (unsavedScrollAndRenderedContainerDiv !== null) {
        scrollAndRenderedContainerRef.current = unsavedScrollAndRenderedContainerDiv;
        resizeObserver.observe(unsavedScrollAndRenderedContainerDiv);
      }
    }, []);
    (0, import_react49.useEffect)(() => {
      return () => {
        resizeObserver.disconnect();
      };
    }, []);
    const onGridScroll = (e) => {
      const newScrollPosition = calculateNewScrollPosition(
        e,
        totalSize,
        gridState.viewport,
        scrollAndRenderedContainerRef.current
      );
      if (newScrollPosition !== void 0) {
        setGridState((gridState2) => {
          return __spreadProps(__spreadValues({}, gridState2), {
            scrollPosition: newScrollPosition
          });
        });
      }
    };
    const onMouseDown = (e) => {
      var _a2, _b;
      if (editorState !== void 0) {
        const { rowIndex, columnIndex } = getIndexesFromMouseEvent(e);
        if (editorState.rowIndex === -1 && (rowIndex !== editorState.rowIndex || columnIndex !== editorState.columnIndex)) {
          return;
        }
        if (columnIndex !== void 0 && (sheetData == null ? void 0 : sheetData.data[columnIndex]) !== void 0) {
          const cellEditorContainer = editorState.editorLocation === "cell" ? containerRef.current : props.mitoContainerRef.current;
          const { selectionStart, selectionEnd } = getCellEditorInputCurrentSelection(cellEditorContainer);
          const newInputSelectionStart = firstNonNullOrUndefined(
            (_a2 = editorState.pendingSelections) == null ? void 0 : _a2.inputSelectionStart,
            selectionStart
          );
          const newInputSelectionEnd = firstNonNullOrUndefined(
            (_b = editorState.pendingSelections) == null ? void 0 : _b.inputSelectionEnd,
            selectionEnd
          );
          const newSelection = [{
            startingRowIndex: rowIndex !== void 0 ? rowIndex : -1,
            endingRowIndex: rowIndex !== void 0 ? rowIndex : -1,
            startingColumnIndex: columnIndex,
            endingColumnIndex: columnIndex
          }];
          setGridState((prevGridState) => {
            return __spreadProps(__spreadValues({}, prevGridState), {
              selections: newSelection
            });
          });
          return setEditorState(__spreadProps(__spreadValues({}, editorState), {
            pendingSelections: {
              selections: newSelection,
              inputSelectionStart: newInputSelectionStart,
              inputSelectionEnd: newInputSelectionEnd
            },
            arrowKeysScrollInFormula: false
          }));
        }
        return;
      } else {
        focusGrid(containerRef.current);
        setMouseDown(true);
        const { rowIndex, columnIndex } = getIndexesFromMouseEvent(e);
        if (rowIndex === void 0 || columnIndex === void 0) {
          return;
        }
        if (e.button === 2 && getIsCellSelected(gridState.selections, rowIndex, columnIndex)) {
          return;
        }
        if (e.metaKey || e.ctrlKey) {
          if (e.shiftKey) {
            setGridState((gridState2) => {
              const selectionsCopy = [...gridState2.selections];
              selectionsCopy.push({
                startingRowIndex: rowIndex,
                endingRowIndex: rowIndex,
                startingColumnIndex: columnIndex,
                endingColumnIndex: columnIndex
              });
              return __spreadProps(__spreadValues({}, gridState2), {
                selections: selectionsCopy
              });
            });
          } else {
            if (rowIndex === -1) {
              if (getIsCellSelected(gridState.selections, -1, columnIndex)) {
                setGridState((gridState2) => {
                  return __spreadProps(__spreadValues({}, gridState2), {
                    selections: removeColumnFromSelections(gridState2.selections, columnIndex)
                  });
                });
              } else {
                setGridState((gridState2) => {
                  const selectionsCopy = [...gridState2.selections];
                  selectionsCopy.push({
                    startingRowIndex: rowIndex,
                    endingRowIndex: rowIndex,
                    startingColumnIndex: columnIndex,
                    endingColumnIndex: columnIndex
                  });
                  return __spreadProps(__spreadValues({}, gridState2), {
                    selections: selectionsCopy
                  });
                });
              }
            } else {
              if (!getIsCellSelected(props.gridState.selections, rowIndex, columnIndex)) {
                const selectionsCopy = [...gridState.selections];
                selectionsCopy.push({
                  startingRowIndex: rowIndex,
                  endingRowIndex: rowIndex,
                  startingColumnIndex: columnIndex,
                  endingColumnIndex: columnIndex
                });
                setGridState((gridState2) => {
                  return __spreadProps(__spreadValues({}, gridState2), {
                    selections: selectionsCopy
                  });
                });
              } else {
                setGridState((gridState2) => {
                  return __spreadProps(__spreadValues({}, gridState2), {
                    selections: [{
                      startingRowIndex: rowIndex,
                      endingRowIndex: rowIndex,
                      startingColumnIndex: columnIndex,
                      endingColumnIndex: columnIndex
                    }]
                  });
                });
              }
            }
          }
          return;
        } else {
          if (e.shiftKey) {
            const selectionsCopy = [...gridState.selections];
            selectionsCopy[selectionsCopy.length - 1] = getNewSelectionAfterMouseUp(selectionsCopy[selectionsCopy.length - 1], rowIndex, columnIndex);
            setGridState((gridState2) => {
              return __spreadProps(__spreadValues({}, gridState2), {
                selections: selectionsCopy
              });
            });
          } else {
            setGridState((gridState2) => {
              return __spreadProps(__spreadValues({}, gridState2), {
                selections: [{
                  startingRowIndex: rowIndex,
                  endingRowIndex: rowIndex,
                  startingColumnIndex: columnIndex,
                  endingColumnIndex: columnIndex
                }]
              });
            });
          }
        }
        if (columnIndex === -1) {
          setUIState((prevUIState) => {
            if (prevUIState.currOpenTaskpane.type === "control_panel" /* CONTROL_PANEL */) {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: { type: "none" /* NONE */ }
              });
            }
            return prevUIState;
          });
        }
      }
    };
    const onMouseUp = (e) => {
      if (editorState !== void 0) {
        return;
      }
      focusGrid(containerRef.current);
      setMouseDown(false);
      const { rowIndex, columnIndex } = getIndexesFromMouseEvent(e);
      if (e.shiftKey || e.metaKey) {
        return;
      }
      if (e.button === 2 && rowIndex && columnIndex && getIsCellSelected(gridState.selections, rowIndex, columnIndex)) {
        return;
      }
      const newLastSelection = getNewSelectionAfterMouseUp(gridState.selections[gridState.selections.length - 1], rowIndex, columnIndex);
      const newSelections = [...gridState.selections];
      newSelections[newSelections.length - 1] = newLastSelection;
      if (!equalSelections(newLastSelection, gridState.selections[gridState.selections.length - 1])) {
        setGridState((gridState2) => {
          return __spreadProps(__spreadValues({}, gridState2), {
            selections: newSelections
          });
        });
      }
    };
    (0, import_react49.useEffect)(() => {
      if (mouseDown) {
        const updateSelectionOnMouseDrag = (e) => {
          const { rowIndex, columnIndex } = getIndexesFromMouseEvent(e);
          setGridState((gridState2) => {
            const newLastSelection = getNewSelectionAfterMouseUp(gridState2.selections[gridState2.selections.length - 1], rowIndex, columnIndex);
            const newSelections = [...gridState2.selections];
            newSelections[newSelections.length - 1] = newLastSelection;
            return __spreadProps(__spreadValues({}, gridState2), {
              selections: newSelections
            });
          });
        };
        const containerDiv = containerRef.current;
        if (gridState.selections[gridState.selections.length - 1].startingRowIndex === -1) {
          return;
        }
        containerDiv == null ? void 0 : containerDiv.addEventListener("mousemove", updateSelectionOnMouseDrag);
        return () => {
          containerDiv == null ? void 0 : containerDiv.removeEventListener("mousemove", updateSelectionOnMouseDrag);
        };
      }
    }, [mouseDown, gridState, setGridState]);
    const onDoubleClick = (e) => {
      const { rowIndex, columnIndex } = getIndexesFromMouseEvent(e);
      if (rowIndex === void 0 || columnIndex === void 0 || getIsHeader(rowIndex, columnIndex)) {
        return;
      }
      const { startingColumnFormula, arrowKeysScrollInFormula, editingMode } = getStartingFormula(sheetData, props.editorState, rowIndex, columnIndex);
      setEditorState({
        rowIndex,
        columnIndex,
        formula: startingColumnFormula,
        arrowKeysScrollInFormula,
        editorLocation: "cell",
        editingMode
      });
    };
    (0, import_react49.useEffect)(() => {
      const onKeyDown = (e) => {
        if (editorState !== void 0) {
          return;
        }
        if (KEYS_TO_IGNORE_IF_PRESSED_ALONE.includes(e.key)) {
          return;
        }
        if (KEYBOARD_SHORTCUTS_TO_IGNORE_WITH_CONTROL.includes(e.key) || e.ctrlKey) {
          return;
        }
        if (!isNavigationKeyPressed(e.key)) {
          if (e.metaKey || e.key === "Escape") {
            return;
          }
          if (e.key === "Backspace" || e.key === "Delete") {
            if (isSelectionsOnlyColumnHeaders(gridState.selections)) {
              const columnIndexesSelected = getColumnIndexesInSelections(gridState.selections);
              const columnIDsToDelete = columnIndexesSelected.map((colIdx) => {
                var _a2;
                return (_a2 = sheetData == null ? void 0 : sheetData.data[colIdx]) == null ? void 0 : _a2.columnID;
              });
              if (columnIDsToDelete !== void 0) {
                props.closeOpenEditingPopups();
                void mitoAPI.editDeleteColumn(
                  sheetIndex,
                  columnIDsToDelete
                );
              }
              return;
            } else if (isSelectionsOnlyIndexHeaders(gridState.selections)) {
              void props.mitoAPI.editDeleteRow(props.sheetIndex, getSelectedRowLabelsWithEntireSelectedRow(gridState.selections, sheetData));
              return;
            }
          }
          setGridState((gridState2) => {
            const lastSelection = gridState2.selections[gridState2.selections.length - 1];
            const { startingColumnFormula, arrowKeysScrollInFormula, editingMode } = getStartingFormula(sheetData, void 0, lastSelection.startingRowIndex, lastSelection.startingColumnIndex, e);
            setEditorState({
              rowIndex: lastSelection.startingRowIndex,
              columnIndex: lastSelection.startingColumnIndex,
              formula: startingColumnFormula,
              arrowKeysScrollInFormula,
              editorLocation: "cell",
              editingMode
            });
            e.preventDefault();
            return __spreadProps(__spreadValues({}, gridState2), {
              selections: [{
                startingRowIndex: lastSelection.startingRowIndex,
                endingRowIndex: lastSelection.startingRowIndex,
                startingColumnIndex: lastSelection.startingColumnIndex,
                endingColumnIndex: lastSelection.startingColumnIndex
              }]
            });
          });
          return;
        } else {
          e.preventDefault();
          setGridState((gridState2) => {
            const newSelection = getNewSelectionAfterKeyPress(gridState2.selections[gridState2.selections.length - 1], e, sheetData);
            ensureCellVisible(
              containerRef.current,
              scrollAndRenderedContainerRef.current,
              currentSheetView,
              gridState2,
              newSelection.endingRowIndex,
              newSelection.endingColumnIndex
            );
            return __spreadProps(__spreadValues({}, gridState2), {
              selections: [newSelection]
            });
          });
        }
      };
      const containerDiv = containerRef.current;
      containerDiv == null ? void 0 : containerDiv.addEventListener("keydown", onKeyDown);
      return () => containerDiv == null ? void 0 : containerDiv.removeEventListener("keydown", onKeyDown);
    }, [editorState, setEditorState, sheetData, currentSheetView, mitoAPI, gridState.selections, sheetIndex, setGridState]);
    return /* @__PURE__ */ import_react49.default.createElement(import_react49.default.Fragment, null, /* @__PURE__ */ import_react49.default.createElement(
      FormulaBar_default,
      {
        sheetData,
        selection: gridState.selections[gridState.selections.length - 1],
        sheetIndex: props.sheetIndex,
        editorState,
        setEditorState: props.setEditorState,
        gridState: props.gridState,
        setGridState: props.setGridState,
        setUIState: props.setUIState,
        scrollAndRenderedContainerRef,
        containerRef,
        mitoAPI: props.mitoAPI,
        closeOpenEditingPopups: props.closeOpenEditingPopups
      }
    ), /* @__PURE__ */ import_react49.default.createElement(
      "div",
      {
        className: "endo-grid-container",
        ref: containerRef,
        tabIndex: -1,
        onMouseDown,
        onMouseUp,
        onMouseLeave: () => setMouseDown(false),
        onDoubleClick
      },
      sheetData !== void 0 && /* @__PURE__ */ import_react49.default.createElement(import_react49.default.Fragment, null, /* @__PURE__ */ import_react49.default.createElement(
        ColumnHeaders_default,
        {
          sheetData,
          setUIState,
          sheetIndex,
          containerRef,
          editorState,
          setEditorState,
          scrollAndRenderedContainerRef,
          gridState,
          setGridState,
          mitoAPI,
          closeOpenEditingPopups: props.closeOpenEditingPopups
        }
      ), /* @__PURE__ */ import_react49.default.createElement(
        IndexHeaders_default,
        {
          sheetData,
          gridState,
          mitoAPI,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          sheetIndex
        }
      )),
      /* @__PURE__ */ import_react49.default.createElement("div", { className: "endo-scroller-and-renderer-container", ref: setScrollAndRendererContainerRef, onScroll: onGridScroll }, /* @__PURE__ */ import_react49.default.createElement(
        EmptyGridMessages_default,
        {
          setUIState: props.setUIState,
          sheetData,
          mitoAPI,
          uiState: props.uiState,
          commCreationStatus: props.commCreationStatus
        }
      ), /* @__PURE__ */ import_react49.default.createElement(
        "div",
        {
          id: "scroller",
          style: {
            height: `${totalSize.height}px`,
            width: `${totalSize.width}px`
          }
        }
      ), /* @__PURE__ */ import_react49.default.createElement(
        "div",
        {
          className: "renderer",
          style: {
            transform: `translate(${gridState.scrollPosition.scrollLeft - translate.x}px, ${gridState.scrollPosition.scrollTop - translate.y}px)`
          },
          onContextMenu: () => {
            void props.mitoAPI.log("right_clicked_on_sheet_data");
          }
        },
        /* @__PURE__ */ import_react49.default.createElement(
          GridData_default,
          {
            sheetData,
            gridState,
            uiState,
            editorState
          }
        )
      )),
      sheetData !== void 0 && editorState !== void 0 && editorState.editorLocation === "cell" && editorState.rowIndex > -1 && /* @__PURE__ */ import_react49.default.createElement(
        FloatingCellEditor_default,
        {
          sheetData,
          sheetIndex,
          gridState,
          editorState,
          setGridState,
          setEditorState,
          setUIState,
          scrollAndRenderedContainerRef,
          containerRef,
          mitoAPI,
          closeOpenEditingPopups: props.closeOpenEditingPopups
        }
      )
    ));
  }
  var EndoGrid_default = EndoGrid;

  // src/components/endo/selectionUtils.tsx
  var getIsCellSelected = (selections, rowIndex, columnIndex) => {
    let isSelected = false;
    selections.forEach((selection) => {
      isSelected = isSelected || getIsCellInSingleSelection(selection, rowIndex, columnIndex);
    });
    return isSelected;
  };
  var getIsCellInSingleSelection = (selection, rowIndex, columnIndex) => {
    const lowerRowIndex = selection.startingRowIndex < selection.endingRowIndex ? selection.startingRowIndex : selection.endingRowIndex;
    const higherRowIndex = selection.startingRowIndex > selection.endingRowIndex ? selection.startingRowIndex : selection.endingRowIndex;
    const rowSelected = lowerRowIndex <= rowIndex && rowIndex <= higherRowIndex;
    const lowerColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
    const higherColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
    const columnSelected = lowerColumnIndex <= columnIndex && columnIndex <= higherColumnIndex;
    if (rowSelected && columnSelected) {
      return true;
    }
    if (lowerRowIndex <= -1 && higherRowIndex <= -1) {
      return columnSelected;
    }
    if (lowerColumnIndex <= -1 && higherColumnIndex <= -1) {
      return rowSelected;
    }
    return false;
  };
  var getIsHeader = (rowIndex, columnIndex) => {
    return rowIndex <= -1 || columnIndex <= -1;
  };
  var getIndexesFromXAndY = (clientX, clientY) => {
    let element = document.elementFromPoint(clientX, clientY);
    let rowIndex = void 0;
    let columnIndex = void 0;
    while (element) {
      const rowIndexAttribute = element == null ? void 0 : element.getAttribute("mito-row-index");
      rowIndex = rowIndex !== void 0 ? rowIndex : typeof rowIndexAttribute === "string" ? parseInt(rowIndexAttribute) : void 0;
      const columnIndexAttribute = element == null ? void 0 : element.getAttribute("mito-col-index");
      columnIndex = columnIndex !== void 0 ? columnIndex : typeof columnIndexAttribute === "string" ? parseInt(columnIndexAttribute) : void 0;
      if (rowIndex !== void 0 && columnIndex !== void 0) {
        return {
          rowIndex,
          columnIndex
        };
      }
      element = element.parentElement;
    }
    return {
      rowIndex,
      columnIndex
    };
  };
  var getIndexesFromMouseEvent = (e) => {
    return getIndexesFromXAndY(e.clientX, e.clientY);
  };
  var getNewSelectionAfterMouseUp = (selection, rowIndex, columnIndex) => {
    if (rowIndex === void 0 || columnIndex === void 0) {
      return selection;
    }
    return {
      startingRowIndex: selection.startingRowIndex,
      endingRowIndex: rowIndex,
      startingColumnIndex: selection.startingColumnIndex,
      endingColumnIndex: columnIndex
    };
  };
  var isNavigationKeyPressed = (key2) => {
    const arrowUp = key2 === "Up" || key2 === "ArrowUp";
    const arrowDown = key2 === "Down" || key2 === "ArrowDown";
    const arrowLeft = key2 === "Left" || key2 === "ArrowLeft";
    const arrowRight = key2 === "Right" || key2 === "ArrowRight";
    const tabPressed = key2 === "Tab";
    return arrowUp || arrowDown || arrowLeft || arrowRight || tabPressed;
  };
  var getNewSelectionAfterKeyPress = (selection, e, sheetData) => {
    if (!isNavigationKeyPressed(e.key)) {
      return selection;
    }
    const arrowUp = e.key === "Up" || e.key === "ArrowUp";
    const arrowDown = e.key === "Down" || e.key === "ArrowDown";
    const arrowLeft = e.key === "Left" || e.key === "ArrowLeft";
    const arrowRight = e.key === "Right" || e.key === "ArrowRight";
    const tabPressed = e.key === "Tab";
    const shiftPressed = e.shiftKey;
    const metaKeyPressed = e.metaKey;
    let startingRowIndex = selection.startingRowIndex;
    let endingRowIndex = selection.endingRowIndex;
    let startingColumnIndex = selection.startingColumnIndex;
    let endingColumnIndex = selection.endingColumnIndex;
    const numRows = Math.min((sheetData == null ? void 0 : sheetData.numRows) || 0, MAX_ROWS);
    const numColumns = (sheetData == null ? void 0 : sheetData.numColumns) || 0;
    if (arrowUp) {
      if (shiftPressed) {
        if (metaKeyPressed) {
          if (selection.endingRowIndex === 0 || selection.endingRowIndex <= -1) {
            endingRowIndex = -1;
          } else {
            endingRowIndex = 0;
          }
        } else {
          endingRowIndex = Math.max(selection.endingRowIndex - 1, -1);
        }
      } else {
        if (metaKeyPressed) {
          if (selection.startingRowIndex === 0 || selection.startingRowIndex <= -1) {
            startingRowIndex = -1;
          } else {
            startingRowIndex = 0;
          }
        } else {
          startingRowIndex = Math.max(selection.startingRowIndex - 1, -1);
        }
        endingRowIndex = startingRowIndex;
        endingColumnIndex = startingColumnIndex;
      }
    } else if (arrowDown) {
      if (shiftPressed) {
        if (metaKeyPressed) {
          endingRowIndex = numRows - 1;
        } else {
          endingRowIndex = Math.min(selection.endingRowIndex + 1, numRows - 1);
        }
      } else {
        if (metaKeyPressed) {
          startingRowIndex = numRows - 1;
        } else {
          startingRowIndex = Math.min(selection.startingRowIndex + 1, numRows - 1);
        }
        endingRowIndex = startingRowIndex;
        endingColumnIndex = startingColumnIndex;
      }
    } else if (arrowLeft) {
      if (shiftPressed) {
        if (metaKeyPressed) {
          if (selection.endingColumnIndex === 0 || selection.endingColumnIndex <= -1) {
            endingColumnIndex = -1;
          } else {
            endingColumnIndex = 0;
          }
        } else {
          endingColumnIndex = Math.max(selection.endingColumnIndex - 1, -1);
        }
      } else {
        if (metaKeyPressed) {
          if (selection.startingColumnIndex === 0 || selection.startingColumnIndex <= -1) {
            startingColumnIndex = -1;
          } else {
            startingColumnIndex = 0;
          }
        } else {
          startingColumnIndex = Math.max(selection.startingColumnIndex - 1, -1);
        }
        endingColumnIndex = startingColumnIndex;
        endingRowIndex = startingRowIndex;
      }
    } else if (arrowRight) {
      if (shiftPressed) {
        if (metaKeyPressed) {
          endingColumnIndex = numColumns - 1;
        } else {
          endingColumnIndex = Math.min(selection.endingColumnIndex + 1, numColumns - 1);
        }
      } else {
        if (metaKeyPressed) {
          startingColumnIndex = numColumns - 1;
        } else {
          startingColumnIndex = Math.min(selection.startingColumnIndex + 1, numColumns - 1);
        }
        endingColumnIndex = startingColumnIndex;
        endingRowIndex = startingRowIndex;
      }
    } else if (tabPressed) {
      if (shiftPressed) {
        if (startingColumnIndex - 1 < -1) {
          if (startingRowIndex > -1) {
            startingColumnIndex = numColumns - 1;
            startingRowIndex -= 1;
          }
        } else {
          startingColumnIndex -= 1;
          if (startingColumnIndex <= -1 && startingRowIndex <= -1) {
            startingColumnIndex = 0;
          }
        }
      } else {
        if (startingColumnIndex + 1 > numColumns - 1) {
          if (startingRowIndex < numRows - 1) {
            startingRowIndex += 1;
            startingColumnIndex = -1;
          }
        } else {
          startingColumnIndex += 1;
        }
      }
      endingRowIndex = startingRowIndex;
      endingColumnIndex = startingColumnIndex;
    }
    return {
      startingRowIndex,
      endingRowIndex,
      startingColumnIndex,
      endingColumnIndex
    };
  };
  var getColumnIndexesInSelections = (selections) => {
    let columnIndexes = [];
    selections.forEach((selection) => {
      columnIndexes = columnIndexes.concat(getColumnIndexesInSingleSelection(selection));
    });
    columnIndexes = [...new Set(columnIndexes)];
    return columnIndexes;
  };
  var getColumnIndexesInSingleSelection = (selection) => {
    const min = Math.min(selection.startingColumnIndex, selection.endingColumnIndex);
    const max = Math.max(selection.startingColumnIndex, selection.endingColumnIndex);
    const columnIndexes = [];
    for (let i = min; i <= max; i++) {
      columnIndexes.push(i);
    }
    return columnIndexes;
  };
  var getColumnHeadersInSelection = (selection, sheetData) => {
    const min = Math.min(selection.startingColumnIndex, selection.endingColumnIndex);
    const max = Math.max(selection.startingColumnIndex, selection.endingColumnIndex);
    const columnHeaders = [];
    for (let i = min; i < max + 1; i++) {
      if (sheetData.data[i] === void 0)
        continue;
      columnHeaders.push(sheetData.data[i].columnHeader);
    }
    if (min !== selection.startingColumnIndex) {
      return columnHeaders.reverse();
    }
    return columnHeaders;
  };
  var getIndexLabelsInSelection = (selection, sheetData) => {
    const min = Math.min(selection.startingRowIndex, selection.endingRowIndex);
    const max = Math.max(selection.startingRowIndex, selection.endingRowIndex);
    const indexLabels = [];
    for (let i = min; i < max + 1; i++) {
      if (sheetData.index[i] === void 0)
        continue;
      indexLabels.push(sheetData.index[i]);
    }
    return indexLabels;
  };
  var isSelectionsOnlyColumnHeaders = (selections) => {
    let isOnlyColumnHeaders = true;
    selections.forEach((selection) => {
      if (selection.startingRowIndex !== -1 || selection.endingRowIndex !== -1) {
        isOnlyColumnHeaders = false;
      }
    });
    return isOnlyColumnHeaders;
  };
  var isSelectionsOnlyIndexHeaders = (selections) => {
    let isOnlyIndexHeaders = true;
    selections.forEach((selection) => {
      if (selection.startingColumnIndex !== -1 || selection.endingColumnIndex !== -1) {
        isOnlyIndexHeaders = false;
      }
    });
    return isOnlyIndexHeaders;
  };
  var COPIED_BORDER_STYLE = "1px dashed black";
  var SELECTED_BORDER_STYLE = "1px solid var(--mito-purple)";
  var DEFAULT_BORDER_STYLE = ".5px solid var(--mito-light-gray)";
  var getBorderStyle = (selections, copiedSelections, rowIndex, columnIndex, numRows) => {
    const borderStyle = {};
    selections.forEach((selection) => {
      const newBorderStyle = _getBorderStyle(selection, rowIndex, columnIndex, numRows, SELECTED_BORDER_STYLE);
      borderStyle.borderRight = combineBorderStyles(borderStyle.borderRight, newBorderStyle.borderRight);
      borderStyle.borderLeft = combineBorderStyles(borderStyle.borderLeft, newBorderStyle.borderLeft);
      borderStyle.borderTop = combineBorderStyles(borderStyle.borderTop, newBorderStyle.borderTop);
      borderStyle.borderBottom = combineBorderStyles(borderStyle.borderBottom, newBorderStyle.borderBottom);
    });
    copiedSelections.forEach((selection) => {
      const newBorderStyle = _getBorderStyle(selection, rowIndex, columnIndex, numRows, COPIED_BORDER_STYLE);
      borderStyle.borderRight = combineBorderStyles(borderStyle.borderRight, newBorderStyle.borderRight);
      borderStyle.borderLeft = combineBorderStyles(borderStyle.borderLeft, newBorderStyle.borderLeft);
      borderStyle.borderTop = combineBorderStyles(borderStyle.borderTop, newBorderStyle.borderTop);
      borderStyle.borderBottom = combineBorderStyles(borderStyle.borderBottom, newBorderStyle.borderBottom);
    });
    return borderStyle;
  };
  var _getBorderStyle = (selection, rowIndex, columnIndex, numRows, inSelectionBorderStyle) => {
    if (!getIsCellSelected([selection], rowIndex, columnIndex)) {
      return {
        borderRight: DEFAULT_BORDER_STYLE,
        borderLeft: columnIndex !== -1 ? DEFAULT_BORDER_STYLE : void 0
      };
    }
    const lowerRowIndex = selection.startingRowIndex < selection.endingRowIndex ? selection.startingRowIndex : selection.endingRowIndex;
    const higherRowIndex = selection.startingRowIndex > selection.endingRowIndex ? selection.startingRowIndex : selection.endingRowIndex;
    const lowerColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
    const higherColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
    const borderTop = lowerRowIndex === rowIndex ? inSelectionBorderStyle : void 0;
    const borderBottom = higherRowIndex === rowIndex || higherRowIndex <= -1 && rowIndex === numRows - 1 ? inSelectionBorderStyle : void 0;
    const borderLeft = lowerColumnIndex === columnIndex ? inSelectionBorderStyle : void 0;
    const borderRight = higherColumnIndex === columnIndex ? inSelectionBorderStyle : void 0;
    if (lowerRowIndex <= -1 && higherRowIndex <= -1) {
      if (rowIndex <= -1) {
        return {
          borderTop: inSelectionBorderStyle,
          borderLeft: borderLeft || DEFAULT_BORDER_STYLE,
          borderRight: borderRight || DEFAULT_BORDER_STYLE
        };
      } else {
        return {
          borderLeft: borderLeft || DEFAULT_BORDER_STYLE,
          borderRight: borderRight || DEFAULT_BORDER_STYLE,
          borderBottom
        };
      }
    }
    if (lowerColumnIndex <= -1 && higherColumnIndex <= -1) {
      if (columnIndex <= -1) {
        return {
          borderTop,
          borderBottom,
          borderLeft: inSelectionBorderStyle,
          borderRight: DEFAULT_BORDER_STYLE
        };
      } else {
        return {
          borderTop,
          borderBottom,
          borderLeft: DEFAULT_BORDER_STYLE,
          borderRight: DEFAULT_BORDER_STYLE
        };
      }
    }
    return {
      borderTop,
      borderBottom,
      borderLeft: borderLeft || DEFAULT_BORDER_STYLE,
      borderRight: borderRight || DEFAULT_BORDER_STYLE
    };
  };
  var combineBorderStyles = (oldBorderStyle, newBorderStyle) => {
    if (oldBorderStyle === COPIED_BORDER_STYLE || newBorderStyle === COPIED_BORDER_STYLE) {
      return COPIED_BORDER_STYLE;
    }
    if (oldBorderStyle === SELECTED_BORDER_STYLE || newBorderStyle === SELECTED_BORDER_STYLE) {
      return SELECTED_BORDER_STYLE;
    }
    if (oldBorderStyle === DEFAULT_BORDER_STYLE || newBorderStyle === DEFAULT_BORDER_STYLE) {
      return DEFAULT_BORDER_STYLE;
    }
    return oldBorderStyle;
  };
  var equalSelections = (selectionOne, selectionTwo) => {
    return selectionOne.startingRowIndex === selectionTwo.startingRowIndex && selectionOne.endingRowIndex === selectionTwo.endingRowIndex && selectionOne.startingColumnIndex === selectionTwo.startingColumnIndex && selectionOne.endingColumnIndex === selectionTwo.endingColumnIndex;
  };
  var getDeletedIndexes = (oldArray, newArray) => {
    if (newArray.length < oldArray.length) {
      const oldDeletedIndexes = [];
      let oldIndex = 0;
      let newIndex = 0;
      while (oldIndex < oldArray.length && newIndex < newArray.length) {
        if (oldArray[oldIndex] !== newArray[newIndex]) {
          oldDeletedIndexes.push(oldIndex);
          oldIndex++;
        } else {
          newIndex++;
          oldIndex++;
        }
      }
      return oldDeletedIndexes;
    }
    return [];
  };
  var reconciliateSelections = (oldSheetIndex, newSheetIndex, selections, oldColumnIDsArray, sheetData) => {
    return selections.map((selection) => reconciliateSingleSelection(oldSheetIndex, newSheetIndex, selection, oldColumnIDsArray, sheetData));
  };
  var reconciliateSingleSelection = (oldSheetIndex, newSheetIndex, selection, oldColumnIDsArray, sheetData) => {
    if (oldColumnIDsArray === void 0 || oldSheetIndex !== newSheetIndex || sheetData === void 0) {
      return {
        startingRowIndex: -1,
        endingRowIndex: -1,
        startingColumnIndex: 0,
        endingColumnIndex: 0
      };
    }
    const newColumnsIDsArray = sheetData.data.map((c) => c.columnID);
    if (oldColumnIDsArray.length > newColumnsIDsArray.length) {
      const oldDeletedIndexes = getDeletedIndexes(oldColumnIDsArray, newColumnsIDsArray);
      const lowerColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
      const higherColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
      let numDeletedBeforeSelection = 0;
      let numDeletedInSelection = 0;
      for (let i = 0; i < oldDeletedIndexes.length; i++) {
        const deletedIndex = oldDeletedIndexes[i];
        if (deletedIndex <= lowerColumnIndex) {
          numDeletedBeforeSelection += 1;
        } else if (deletedIndex > lowerColumnIndex && deletedIndex <= higherColumnIndex) {
          numDeletedInSelection += 1;
        }
      }
      let newLowerColumnIndex = lowerColumnIndex - numDeletedBeforeSelection;
      let newHigherColumnIndex = higherColumnIndex - numDeletedBeforeSelection - numDeletedInSelection;
      if (selection.startingColumnIndex > -1 && selection.endingColumnIndex > -1) {
        newLowerColumnIndex = Math.max(newLowerColumnIndex, 0);
        newHigherColumnIndex = Math.max(newHigherColumnIndex, 0);
      }
      if (newLowerColumnIndex > sheetData.numColumns - 1) {
        newLowerColumnIndex = sheetData.numColumns - 1;
      }
      if (newHigherColumnIndex > sheetData.numColumns - 1) {
        newHigherColumnIndex = sheetData.numColumns - 1;
      }
      const newStartingColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? newLowerColumnIndex : newHigherColumnIndex;
      const newEndingColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? newLowerColumnIndex : newHigherColumnIndex;
      return {
        startingRowIndex: selection.startingRowIndex,
        endingRowIndex: selection.endingRowIndex,
        startingColumnIndex: newStartingColumnIndex,
        endingColumnIndex: newEndingColumnIndex
      };
    } else if (oldColumnIDsArray.length < newColumnsIDsArray.length) {
      const oldAddedIndexes = getDeletedIndexes(newColumnsIDsArray, oldColumnIDsArray);
      const lowerColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
      const higherColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
      let numAddedBeforeSelection = 0;
      let numAddedInSelection = 0;
      for (let i = 0; i < oldAddedIndexes.length; i++) {
        const addedIndex = oldAddedIndexes[i];
        if (addedIndex <= lowerColumnIndex) {
          numAddedBeforeSelection += 1;
        } else if (addedIndex > lowerColumnIndex && addedIndex <= higherColumnIndex) {
          numAddedInSelection += 1;
        }
      }
      const newLowerColumnIndex = lowerColumnIndex + numAddedBeforeSelection;
      const newHigherColumnIndex = higherColumnIndex + numAddedBeforeSelection + numAddedInSelection;
      const newStartingColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? newLowerColumnIndex : newHigherColumnIndex;
      const newEndingColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? newLowerColumnIndex : newHigherColumnIndex;
      return {
        startingRowIndex: selection.startingRowIndex,
        endingRowIndex: selection.endingRowIndex,
        startingColumnIndex: newStartingColumnIndex,
        endingColumnIndex: newEndingColumnIndex
      };
    }
    return selection;
  };
  var removeColumnFromSelections = (selections, columnIndex) => {
    const newSelections = [];
    selections.forEach((selection) => {
      if (!isSelectionsOnlyColumnHeaders([selection]) || !getIsCellInSingleSelection(selection, -1, columnIndex)) {
        newSelections.push(selection);
      } else {
        const smallerColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
        const largerColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
        if (smallerColumnIndex < columnIndex) {
          newSelections.push({
            startingRowIndex: -1,
            endingRowIndex: -1,
            startingColumnIndex: smallerColumnIndex,
            endingColumnIndex: columnIndex - 1
          });
        }
        if (largerColumnIndex > columnIndex) {
          newSelections.push({
            startingRowIndex: -1,
            endingRowIndex: -1,
            startingColumnIndex: columnIndex + 1,
            endingColumnIndex: largerColumnIndex
          });
        }
      }
    });
    if (newSelections.length === 0) {
      newSelections.push({
        startingColumnIndex: 0,
        endingColumnIndex: 0,
        startingRowIndex: 0,
        endingRowIndex: 0
      });
    }
    return newSelections;
  };
  var isSelectionEntireSelectedColumn = (selection) => {
    return selection.startingRowIndex === -1 && selection.endingRowIndex === -1;
  };
  var getSelectedColumnIDsWithEntireSelectedColumn = (selections, sheetData) => {
    if (sheetData === void 0) {
      return [];
    }
    let columnIndexes = [];
    selections.forEach((selection) => {
      if (isSelectionEntireSelectedColumn(selection)) {
        columnIndexes = columnIndexes.concat(getColumnIndexesInSingleSelection(selection));
      }
    });
    columnIndexes = [...new Set(columnIndexes)];
    return columnIndexes.filter((colIdx) => sheetData.data.length > colIdx).map((colIdx) => {
      var _a;
      return (_a = sheetData.data[colIdx]) == null ? void 0 : _a.columnID;
    });
  };
  var getSelectedRowLabelsInSingleSelection = (selection, sheetData) => {
    const min = Math.min(selection.startingRowIndex, selection.endingRowIndex);
    const max = Math.max(selection.startingRowIndex, selection.endingRowIndex);
    const rowIndexes = [];
    for (let i = min; i <= max; i++) {
      rowIndexes.push(sheetData.index[i]);
    }
    return rowIndexes;
  };
  var getSelectedRowLabelsWithEntireSelectedRow = (selections, sheetData) => {
    if (sheetData === void 0) {
      return [];
    }
    let rowIndexes = [];
    selections.forEach((selection) => {
      if (selection.startingColumnIndex === -1 && (selection.endingColumnIndex === -1 || selection.endingColumnIndex === sheetData.numColumns)) {
        rowIndexes = rowIndexes.concat(getSelectedRowLabelsInSingleSelection(selection, sheetData));
      }
    });
    return rowIndexes;
  };
  var getNumberColumnIDs = (sheetData, columnIDs) => {
    const columnIDsAndDtypes = columnIDs.filter((colId) => colId !== void 0).map((columnID) => [columnID, (sheetData == null ? void 0 : sheetData.columnDtypeMap[columnID]) || ""]);
    return columnIDsAndDtypes.filter(([, columnDtype]) => {
      return columnDtype !== void 0 && isNumberDtype(columnDtype);
    }).filter(([columnID]) => {
      return columnID !== void 0;
    }).map(([columnID]) => {
      return columnID;
    });
  };
  var getSelectedNumberSeriesColumnIDs = (selections, sheetData) => {
    if (sheetData === void 0) {
      return [];
    }
    const columnIndexesSelected = getColumnIndexesInSelections(selections);
    const columnIDs = columnIndexesSelected.filter((colIdx) => sheetData.data.length > colIdx).map((colIdx) => {
      var _a;
      return (_a = sheetData.data[colIdx]) == null ? void 0 : _a.columnID;
    });
    return getNumberColumnIDs(sheetData, columnIDs);
  };

  // src/components/taskpanes/ControlPanel/ControlPanelTaskpane.tsx
  var import_react64 = __toESM(require_react());

  // src/components/taskpanes/ControlPanel/ControlPanelTaskpaneTabs.tsx
  var import_react50 = __toESM(require_react());
  function ControlPanelTaskpaneTabs(props) {
    const changeTab = (tab) => {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          selectedColumnControlPanelTab: tab
        });
      });
      void props.mitoAPI.log("clicked_" + tab + "_tab");
    };
    return /* @__PURE__ */ import_react50.default.createElement("div", { className: "control-panel-taskpane-tab-container" }, /* @__PURE__ */ import_react50.default.createElement(
      "div",
      {
        className: classNames("control-panel-taskpane-tab", props.selectedTab === "filter_sort" /* FilterSort */ ? "selected" : "unselected"),
        onClick: () => changeTab("filter_sort" /* FilterSort */)
      },
      /* @__PURE__ */ import_react50.default.createElement("p", null, "Filter/Sort")
    ), /* @__PURE__ */ import_react50.default.createElement(
      "div",
      {
        className: classNames("control-panel-taskpane-tab", props.selectedTab === "unique_values" /* UniqueValues */ ? "selected" : "unselected"),
        onClick: () => changeTab("unique_values" /* UniqueValues */)
      },
      /* @__PURE__ */ import_react50.default.createElement("p", null, "Values")
    ), /* @__PURE__ */ import_react50.default.createElement(
      "div",
      {
        className: classNames("control-panel-taskpane-tab", props.selectedTab === "summary_stats" /* SummaryStats */ ? "selected" : "unselected"),
        onClick: () => changeTab("summary_stats" /* SummaryStats */)
      },
      /* @__PURE__ */ import_react50.default.createElement("p", null, "Summary Stats")
    ));
  }
  var ControlPanelTaskpaneTabs_default = ControlPanelTaskpaneTabs;

  // src/components/taskpanes/ControlPanel/FilterAndSortTab/DtypeCard.tsx
  var import_react51 = __toESM(require_react());
  var DTYPE_DESCRIPTION = "Changes the dtype of the selected column in the underlying dataframe.";
  function getDtypeValue(dtype) {
    if (dtype === void 0) {
      return "str" /* STRING */;
    }
    if (dtype.includes("bool")) {
      return "bool" /* BOOL */;
    } else if (dtype.includes("int")) {
      return "int" /* INT */;
    } else if (dtype.includes("float")) {
      return "float" /* FLOAT */;
    } else if (dtype.includes("str") || dtype.includes("object")) {
      return "str" /* STRING */;
    } else if (dtype.includes("datetime")) {
      return "datetime" /* DATETIME */;
    } else if (dtype.includes("timedelta")) {
      return "timedelta" /* TIMEDELTA */;
    }
    return "str" /* STRING */;
  }
  function getDtypeSelectOptions(onChange) {
    return [
      /* @__PURE__ */ import_react51.default.createElement(
        DropdownItem_default,
        {
          title: "bool" /* BOOL */,
          key: "bool" /* BOOL */,
          onClick: onChange ? () => {
            onChange("bool" /* BOOL */);
          } : void 0
        }
      ),
      /* @__PURE__ */ import_react51.default.createElement(
        DropdownItem_default,
        {
          title: "int" /* INT */,
          key: "int" /* INT */,
          hideSubtext: true,
          displaySubtextOnHover: true,
          onClick: onChange ? () => {
            onChange("int" /* INT */);
          } : void 0
        }
      ),
      /* @__PURE__ */ import_react51.default.createElement(
        DropdownItem_default,
        {
          title: "float" /* FLOAT */,
          key: "float" /* FLOAT */,
          onClick: onChange ? () => {
            onChange("float" /* FLOAT */);
          } : void 0
        }
      ),
      /* @__PURE__ */ import_react51.default.createElement(
        DropdownItem_default,
        {
          title: "str" /* STRING */,
          key: "str" /* STRING */,
          onClick: onChange ? () => {
            onChange("str" /* STRING */);
          } : void 0
        }
      ),
      /* @__PURE__ */ import_react51.default.createElement(
        DropdownItem_default,
        {
          title: "datetime" /* DATETIME */,
          key: "datetime" /* DATETIME */,
          onClick: onChange ? () => {
            onChange("datetime" /* DATETIME */);
          } : void 0
        }
      ),
      /* @__PURE__ */ import_react51.default.createElement(
        DropdownItem_default,
        {
          title: "timedelta" /* TIMEDELTA */,
          key: "timedelta" /* TIMEDELTA */,
          onClick: onChange ? () => {
            onChange("timedelta" /* TIMEDELTA */);
          } : void 0
        }
      )
    ];
  }
  function DtypeCard(props) {
    const [stepID, setStepID] = (0, import_react51.useState)(void 0);
    async function changeColumnDtype(newDtype) {
      const newStepID = await props.mitoAPI.editChangeColumnDtype(
        props.selectedSheetIndex,
        [props.columnID],
        newDtype,
        stepID
      );
      setStepID(newStepID);
    }
    return /* @__PURE__ */ import_react51.default.createElement(import_react51.default.Fragment, null, /* @__PURE__ */ import_react51.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react51.default.createElement(Col_default, { span: 4, title: DTYPE_DESCRIPTION }, /* @__PURE__ */ import_react51.default.createElement("p", { className: "text-header-3" }, "Dtype")), /* @__PURE__ */ import_react51.default.createElement(Col_default, { offset: 2, flex: "1" }, /* @__PURE__ */ import_react51.default.createElement(
      Select_default,
      {
        value: getDtypeValue(props.columnDtype),
        onChange: (newDtype) => {
          void changeColumnDtype(newDtype);
        },
        dropdownWidth: "medium"
      },
      getDtypeSelectOptions()
    ))));
  }
  var DtypeCard_default = DtypeCard;

  // src/components/taskpanes/ControlPanel/FilterAndSortTab/filter/FilterCard.tsx
  var import_react54 = __toESM(require_react());

  // src/components/taskpanes/ControlPanel/FilterAndSortTab/filter/Filter.tsx
  var import_react52 = __toESM(require_react());
  function Filter(props) {
    const inputStyle = CONDITIONS_WITH_NO_INPUT.includes(props.filter.condition) ? { "visibility": "hidden" } : { "visibility": "visible" };
    const filterConditionOptions = getFilterOptions(props.columnDtype, props.nameLength);
    const setOperator = props.setOperator;
    const isDatetime = props.columnDtype && isDatetimeDtype(props.columnDtype) || props.columnDtype === void 0 && DATETIME_SELECT_OPTIONS[props.filter.condition] !== void 0;
    return /* @__PURE__ */ import_react52.default.createElement(Row_default, { justify: "space-between", align: "center", suppressTopBottomMargin: props.suppressTopBottomMargin }, /* @__PURE__ */ import_react52.default.createElement(Col_default, { span: !props.inGroup ? 4 : 5 }, setOperator === void 0 && /* @__PURE__ */ import_react52.default.createElement("p", { className: "text-body-1" }, "Where"), setOperator !== void 0 && /* @__PURE__ */ import_react52.default.createElement(
      Select_default,
      {
        value: props.operator,
        onChange: (newOperator) => setOperator(newOperator),
        dropdownWidth: "small"
      },
      /* @__PURE__ */ import_react52.default.createElement(
        DropdownItem_default,
        {
          title: "And"
        }
      ),
      /* @__PURE__ */ import_react52.default.createElement(
        DropdownItem_default,
        {
          title: "Or"
        }
      )
    )), /* @__PURE__ */ import_react52.default.createElement(Col_default, { span: 7 }, /* @__PURE__ */ import_react52.default.createElement(
      Select_default,
      {
        value: props.filter.condition,
        onChange: (newFilterCondition) => {
          props.setFilter({
            condition: newFilterCondition,
            value: props.filter.value
          });
        },
        width: "block",
        dropdownWidth: "medium"
      },
      filterConditionOptions
    )), /* @__PURE__ */ import_react52.default.createElement(Col_default, { span: 9 }, /* @__PURE__ */ import_react52.default.createElement(
      "input",
      {
        className: "mito-input element-width-block",
        style: inputStyle,
        type: isDatetime ? "date" : "text",
        value: props.filter.value,
        onChange: (e) => {
          props.setFilter({
            condition: props.filter.condition,
            value: e.target.value
          });
        }
      }
    )), props.deleteFilter && /* @__PURE__ */ import_react52.default.createElement(Col_default, null, /* @__PURE__ */ import_react52.default.createElement(XIcon_default, { onClick: props.deleteFilter })));
  }

  // src/components/taskpanes/ControlPanel/FilterAndSortTab/filter/FilterGroup.tsx
  var import_react53 = __toESM(require_react());
  function FilterGroup(props) {
    return /* @__PURE__ */ import_react53.default.createElement("div", { className: "filter-group" }, props.filters.map((filter, index) => {
      return /* @__PURE__ */ import_react53.default.createElement(
        Filter,
        {
          key: index,
          filter,
          operator: props.groupOperator,
          displayOperator: true,
          setFilter: (newFilter) => {
            props.setFilter(index, newFilter);
          },
          setOperator: index === 0 ? void 0 : props.setOperator,
          deleteFilter: () => {
            props.deleteFilter(index);
          },
          inGroup: true,
          columnDtype: props.columnDtype,
          nameLength: "short_name"
        }
      );
    }), /* @__PURE__ */ import_react53.default.createElement(
      TextButton_default,
      {
        variant: "light",
        onClick: props.addFilter,
        width: "medium"
      },
      "+ Add a Filter"
    ));
  }

  // src/components/taskpanes/ControlPanel/FilterAndSortTab/filter/FilterCard.tsx
  var ADD_FILTER_SELECT_TITLE = "+ Add Filter";
  function FilterCard(props) {
    const addFilter = () => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        newFilters.push(getEmptyFilterData(props.columnDtype));
        return newFilters;
      });
    };
    const addFilterGroup = () => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        newFilters.push(
          {
            filters: [
              getEmptyFilterData(props.columnDtype)
            ],
            operator: "And"
          }
        );
        return newFilters;
      });
    };
    const addFilterToGroup = (groupIndex) => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        const filterGroup = newFilters[groupIndex];
        if (isFilterGroup(filterGroup)) {
          filterGroup.filters.push(
            getEmptyFilterData(props.columnDtype)
          );
          return newFilters;
        } else {
          return prevFilters;
        }
      });
    };
    const deleteFilter = (filterIndex) => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        newFilters.splice(filterIndex, 1);
        return newFilters;
      });
    };
    const deleteFilterFromGroup = (groupIndex, filterIndex) => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        const filterGroup = newFilters[groupIndex];
        if (isFilterGroup(filterGroup)) {
          filterGroup.filters.splice(filterIndex, 1);
          if (filterGroup.filters.length === 0) {
            newFilters.splice(groupIndex, 1);
          }
          return newFilters;
        } else {
          return prevFilters;
        }
      });
    };
    const setFilter = (filterIndex, filter) => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        newFilters[filterIndex] = filter;
        return newFilters;
      });
    };
    const setFilterInGroup = (groupIndex, filterIndex, filter) => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        const filterGroup = newFilters[groupIndex];
        if (isFilterGroup(filterGroup)) {
          filterGroup.filters[filterIndex] = filter;
          return newFilters;
        } else {
          return prevFilters;
        }
      });
    };
    const setOperatorInGroup = (groupIndex, operator) => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        const filterGroup = newFilters[groupIndex];
        if (isFilterGroup(filterGroup)) {
          filterGroup.operator = operator;
          return newFilters;
        } else {
          return prevFilters;
        }
      });
    };
    return /* @__PURE__ */ import_react54.default.createElement("div", null, /* @__PURE__ */ import_react54.default.createElement("div", { className: "text-header-3 mt-15px" }, /* @__PURE__ */ import_react54.default.createElement("p", null, " Filter ")), props.filters.map((filterOrGroup, index) => {
      if (isFilterGroup(filterOrGroup)) {
        return /* @__PURE__ */ import_react54.default.createElement(Row_default, { justify: "space-between", align: "top" }, /* @__PURE__ */ import_react54.default.createElement(Col_default, { span: 4 }, index === 0 && /* @__PURE__ */ import_react54.default.createElement("p", { className: "text-body-1" }, "Where"), index !== 0 && /* @__PURE__ */ import_react54.default.createElement(
          Select_default,
          {
            value: props.operator,
            onChange: (newOperator) => props.setOperator(newOperator),
            dropdownWidth: "small"
          },
          /* @__PURE__ */ import_react54.default.createElement(
            DropdownItem_default,
            {
              title: "And"
            }
          ),
          /* @__PURE__ */ import_react54.default.createElement(
            DropdownItem_default,
            {
              title: "Or"
            }
          )
        )), /* @__PURE__ */ import_react54.default.createElement(Col_default, { span: 19 }, /* @__PURE__ */ import_react54.default.createElement(
          FilterGroup,
          {
            key: index,
            mainOperator: props.operator,
            filters: filterOrGroup.filters,
            groupOperator: filterOrGroup.operator,
            setFilter: (filterIndex, newFilter) => {
              setFilterInGroup(index, filterIndex, newFilter);
            },
            setOperator: (newOperator) => {
              setOperatorInGroup(index, newOperator);
            },
            deleteFilter: (filterIndex) => {
              deleteFilterFromGroup(index, filterIndex);
            },
            addFilter: () => addFilterToGroup(index),
            columnDtype: props.columnDtype
          }
        )));
      } else {
        return /* @__PURE__ */ import_react54.default.createElement(
          Filter,
          {
            key: index,
            filter: filterOrGroup,
            operator: props.operator,
            displayOperator: true,
            setFilter: (newFilter) => {
              setFilter(index, newFilter);
            },
            setOperator: index === 0 ? void 0 : props.setOperator,
            deleteFilter: () => {
              deleteFilter(index);
            },
            columnDtype: props.columnDtype,
            nameLength: "short_name"
          }
        );
      }
    }), /* @__PURE__ */ import_react54.default.createElement(
      DropdownButton_default,
      {
        text: ADD_FILTER_SELECT_TITLE,
        width: "medium",
        dropdownWidth: "medium"
      },
      /* @__PURE__ */ import_react54.default.createElement(
        DropdownItem_default,
        {
          title: "Add a Filter",
          onClick: addFilter
        }
      ),
      /* @__PURE__ */ import_react54.default.createElement(
        DropdownItem_default,
        {
          title: "Add a Group of Filters",
          onClick: addFilterGroup
        }
      )
    ), props.editedFilter && /* @__PURE__ */ import_react54.default.createElement(Row_default, { className: "text-subtext-1" }, props.rowDifference >= 0 ? `Removed an additional ${Math.abs(props.rowDifference)} rows` : `Added back ${Math.abs(props.rowDifference)} rows`));
  }
  var FilterCard_default = FilterCard;

  // src/components/taskpanes/ControlPanel/FilterAndSortTab/SortCard.tsx
  var import_react55 = __toESM(require_react());
  var SortCard = (props) => {
    const { params, setParams } = useLiveUpdatingParams_default(void 0, "sort", props.mitoAPI, props.analysisData, 0);
    const updateSortDirection = (newSortDirection) => {
      setParams((prevSortParams) => {
        let finalSortDirection = newSortDirection;
        if (prevSortParams && newSortDirection == prevSortParams.sort_direction) {
          finalSortDirection = "none" /* NONE */;
        }
        return {
          sheet_index: props.selectedSheetIndex,
          column_id: props.columnID,
          sort_direction: finalSortDirection
        };
      });
    };
    const ascendingButtonClass = params && params.sort_direction == "ascending" /* ASCENDING */ ? "sort-button-selected" : "";
    const descendingButtonClass = params && params.sort_direction == "descending" /* DESCENDING */ ? "sort-button-selected" : "";
    return /* @__PURE__ */ import_react55.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react55.default.createElement(Col_default, { span: 4 }, /* @__PURE__ */ import_react55.default.createElement("p", { className: "text-header-3" }, "Sort")), /* @__PURE__ */ import_react55.default.createElement(Col_default, { offset: 2, flex: "1" }, /* @__PURE__ */ import_react55.default.createElement(Row_default, { suppressTopBottomMargin: true }, /* @__PURE__ */ import_react55.default.createElement(Col_default, { flex: "1" }, /* @__PURE__ */ import_react55.default.createElement(
      "button",
      {
        className: classNames("sort-button", ascendingButtonClass),
        onClick: () => updateSortDirection("ascending" /* ASCENDING */)
      },
      "Ascending"
    )), /* @__PURE__ */ import_react55.default.createElement(Col_default, { offset: 1, flex: "1" }, /* @__PURE__ */ import_react55.default.createElement(
      "button",
      {
        className: classNames("sort-button", descendingButtonClass),
        onClick: () => updateSortDirection("descending" /* DESCENDING */)
      },
      "Descending"
    )))));
  };
  var SortCard_default = SortCard;

  // src/components/taskpanes/ControlPanel/SummaryStatsTab/ColumnSummaryGraph.tsx
  var import_react56 = __toESM(require_react());
  function ColumnSummaryGraph(props) {
    const [graphObj, setGraphObj] = (0, import_react56.useState)(void 0);
    async function loadBase64PNGImage() {
      const _graphHTMLAndScript = await props.mitoAPI.getColumnSummaryGraph(
        props.selectedSheetIndex,
        props.columnID,
        "350px",
        "100%"
      );
      setGraphObj(_graphHTMLAndScript);
    }
    (0, import_react56.useEffect)(() => {
      void loadBase64PNGImage();
    }, []);
    (0, import_react56.useEffect)(() => {
      if (graphObj === void 0) {
        return;
      }
      try {
        const executeScript = new Function(graphObj.script);
        executeScript();
      } catch (e) {
        console.error("Failed to execute graph function", e);
      }
    }, [graphObj]);
    return /* @__PURE__ */ import_react56.default.createElement(import_react56.default.Fragment, null, graphObj !== void 0 && /* @__PURE__ */ import_react56.default.createElement("div", { dangerouslySetInnerHTML: { __html: graphObj.html } }), graphObj === void 0 && /* @__PURE__ */ import_react56.default.createElement("div", null, "Loading the summary graph..."));
  }
  var ColumnSummaryGraph_default = ColumnSummaryGraph;

  // src/components/taskpanes/ControlPanel/SummaryStatsTab/ColumnSummaryStatistics.tsx
  var import_react58 = __toESM(require_react());

  // src/components/taskpanes/FillNa/OpenFillNaN.tsx
  var import_react57 = __toESM(require_react());
  var OpenFillNaN = (props) => {
    return /* @__PURE__ */ import_react57.default.createElement(import_react57.default.Fragment, null, "\xA0", /* @__PURE__ */ import_react57.default.createElement(
      "span",
      {
        className: "text-color-medium-gray-important text-underline-on-hover",
        onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "fill_na" /* FILL_NA */, startingColumnIDs: [props.columnID] }
            });
          });
        }
      },
      "(or Fill NaN Values)"
    ));
  };
  var OpenFillNaN_default = OpenFillNaN;

  // src/components/taskpanes/ControlPanel/SummaryStatsTab/ColumnSummaryStatistics.tsx
  var KEY_TO_FORMAT_WITH_COLUMN_FORMAT = [
    "mean",
    "std",
    "min",
    "25%",
    "50%",
    "75%",
    "max",
    "median",
    "sum"
  ];
  function ColumnSummaryStatistics(props) {
    const [describe, setDescribe] = (0, import_react58.useState)({});
    const [loading, setLoading] = (0, import_react58.useState)(true);
    async function loadDescribe() {
      const loadedDescribe = await props.mitoAPI.getColumnDescribe(
        props.selectedSheetIndex,
        props.columnID
      );
      setDescribe(loadedDescribe);
      setLoading(false);
    }
    (0, import_react58.useEffect)(() => {
      void loadDescribe();
    }, []);
    return /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, /* @__PURE__ */ import_react58.default.createElement("div", { className: "text-header-3" }, /* @__PURE__ */ import_react58.default.createElement("p", null, " Column Summary Statistics ")), /* @__PURE__ */ import_react58.default.createElement("div", { key: loading.toString() }, !loading && /* @__PURE__ */ import_react58.default.createElement("table", { className: "column-describe-table-container" }, Object.keys(describe).map((key2) => {
      const value = describe[key2];
      let valueToDisplay = value;
      if (KEY_TO_FORMAT_WITH_COLUMN_FORMAT.includes(key2)) {
        valueToDisplay = formatCellData(value, props.columnDtype, props.columnFormat);
      }
      valueToDisplay = valueToDisplay.substring(0, 15) + (valueToDisplay.length > 15 ? "..." : "");
      return /* @__PURE__ */ import_react58.default.createElement("tr", { className: "column-describe-table-row", key: key2 }, /* @__PURE__ */ import_react58.default.createElement("th", null, key2, key2 === "count: NaN" && valueToDisplay !== "0" && /* @__PURE__ */ import_react58.default.createElement(
        OpenFillNaN_default,
        {
          setUIState: props.setUIState,
          columnID: props.columnID
        }
      )), /* @__PURE__ */ import_react58.default.createElement("th", { title: value }, valueToDisplay));
    })), loading && /* @__PURE__ */ import_react58.default.createElement("p", null, "Column Summary statistics are loading...")));
  }
  var ColumnSummaryStatistics_default = ColumnSummaryStatistics;

  // src/components/taskpanes/ControlPanel/ValuesTab/ValuesTab.tsx
  var import_react61 = __toESM(require_react());

  // src/components/elements/MultiToggleBox.tsx
  var import_react59 = __toESM(require_react());
  var MAX_DISPLAYED = 1e4;
  var MultiToggleBoxMessage = (props) => {
    const _emptyMessage = props.emptyMessage !== void 0 ? props.emptyMessage : "No items to display.";
    if (props.loading) {
      return /* @__PURE__ */ import_react59.default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ import_react59.default.createElement("p", { className: "text-body-1 text-align-center-important" }, "Loading items", /* @__PURE__ */ import_react59.default.createElement(LoadingDots_default, null)));
    } else if (props.maxDisplayed || props.isSubset) {
      return /* @__PURE__ */ import_react59.default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ import_react59.default.createElement("p", { className: "text-body-1 text-align-center-important" }, "There are too many items to display. Search to filter down to the items you care about."));
    } else if (props.numDisplayed === 0) {
      return /* @__PURE__ */ import_react59.default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ import_react59.default.createElement("p", { className: "text-body-1 text-align-center-important" }, _emptyMessage));
    } else if (props.message !== void 0) {
      return /* @__PURE__ */ import_react59.default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ import_react59.default.createElement("p", { className: "text-body-1 text-align-center-important" }, props.message));
    }
    return /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null);
  };
  var MultiToggleSelectedMessage = (props) => {
    let text = `${props.numToggled} selected`;
    if (props.numToggled > 0 && props.numToggled === props.numToggledButNotDisplayed) {
      text = `${props.numToggled} selected and not displayed`;
    } else if (props.numToggledButNotDisplayed > 0) {
      text = `${props.numToggled} selected, of which ${props.numToggledButNotDisplayed} not displayed`;
    }
    return /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, "Toggle ", props.searchString !== "" ? "Displayed" : "All", /* @__PURE__ */ import_react59.default.createElement("span", { className: "text-color-medium-gray-important" }, "\xA0(", text, ")"));
  };
  var MultiToggleBox = (props) => {
    const [_searchString, _setSearchString] = (0, import_react59.useState)("");
    const searchString = props.searchState !== void 0 ? props.searchState.searchString : _searchString;
    const setSearchString = props.searchState !== void 0 ? props.searchState.setSearchString : _setSearchString;
    const setRef = (0, import_react59.useCallback)((unsavedDropdownAnchor) => {
      if (unsavedDropdownAnchor !== null) {
        const firstSelectedChild = unsavedDropdownAnchor.querySelector(".multi-toggle-box-row-selected");
        if (firstSelectedChild !== null) {
          ensureInView(unsavedDropdownAnchor, firstSelectedChild, 0);
        }
      }
    }, []);
    const height = props.height || "block";
    const width = props.width || "block";
    const heightClass = `element-height-${height}`;
    const widthClass = `element-width-${width}`;
    let isAllDisplayedNonDisabledAreToggled = true;
    const nonDisabledDisplayedIndexes = [];
    let numToggled = 0;
    let numToggledButNotDisplayed = 0;
    let numDisplayed = 0;
    let maxDisplayed = false;
    const childrenToDisplay = import_react59.default.Children.map(props.children, (child) => {
      const title = child.props.title;
      const rightText = child.props.rightText;
      const toggled = child.props.toggled;
      if (toggled) {
        numToggled++;
      }
      const noTitleMatch = title === null || title === void 0 || fuzzyMatch(title + "", searchString) < 0.8;
      const noRightTextMatch = title === null || title === void 0 || fuzzyMatch(rightText + "", searchString) < 0.8;
      if (noTitleMatch && noRightTextMatch) {
        if (toggled) {
          numToggledButNotDisplayed++;
        }
        return null;
      }
      if (numDisplayed > MAX_DISPLAYED) {
        maxDisplayed = true;
        return null;
      }
      numDisplayed++;
      const itemDisabled = child.props.disabled || props.disabled;
      if (!itemDisabled) {
        nonDisabledDisplayedIndexes.push(child.props.index);
        isAllDisplayedNonDisabledAreToggled = isAllDisplayedNonDisabledAreToggled && child.props.toggled;
      }
      const copiedChild = import_react59.default.cloneElement(child, {
        disabled: itemDisabled
      });
      return copiedChild;
    });
    const { onToggleAll: toggleAllIndexes } = props;
    return /* @__PURE__ */ import_react59.default.createElement("div", { className: classNames("multi-toggle-box-container", heightClass, widthClass, props.className) }, props.searchable && /* @__PURE__ */ import_react59.default.createElement(
      Input_default,
      {
        value: searchString,
        onChange: (e) => {
          setSearchString(e.target.value);
        },
        placeholder: "Search",
        width: "block",
        className: "mb-2px"
      }
    ), /* @__PURE__ */ import_react59.default.createElement(
      "div",
      {
        className: classNames("multi-toggle-box"),
        style: { height: props.searchable ? "calc(100% - 30px)" : "100%" },
        ref: setRef
      },
      /* @__PURE__ */ import_react59.default.createElement(
        MultiToggleBoxMessage,
        {
          loading: props.loading,
          isSubset: props.isSubset,
          message: props.message,
          emptyMessage: props.emptyMessage,
          maxDisplayed,
          numDisplayed
        }
      ),
      toggleAllIndexes !== void 0 && numDisplayed > 0 && /* @__PURE__ */ import_react59.default.createElement(
        "div",
        {
          key: "Toggle All",
          className: classNames("multi-toggle-box-row", { "multi-toggle-box-row-selected": isAllDisplayedNonDisabledAreToggled }),
          onClick: () => {
            if (props.disabled) {
              return;
            }
            if (!isAllDisplayedNonDisabledAreToggled) {
              toggleAllIndexes(nonDisabledDisplayedIndexes);
            } else {
              toggleAllIndexes([]);
            }
          }
        },
        /* @__PURE__ */ import_react59.default.createElement(
          "input",
          {
            key: "Toggle All",
            type: "checkbox",
            name: "Toggle All",
            checked: isAllDisplayedNonDisabledAreToggled
          }
        ),
        /* @__PURE__ */ import_react59.default.createElement(
          MultiToggleSelectedMessage,
          {
            searchString,
            numToggled,
            numToggledButNotDisplayed
          }
        )
      ),
      childrenToDisplay
    ));
  };
  var MultiToggleBox_default = MultiToggleBox;

  // src/components/elements/MultiToggleItem.tsx
  var import_react60 = __toESM(require_react());
  var MultiToggleItem = (props) => {
    var _a;
    return /* @__PURE__ */ import_react60.default.createElement(
      "div",
      {
        className: classNames(
          "multi-toggle-box-row",
          "text-overflow-hide",
          {
            "multi-toggle-box-row-selected": props.toggled,
            "multi-toggle-box-row-disabled": props.disabled
          }
        ),
        onClick: () => {
          if (props.disabled) {
            return;
          }
          props.onToggle();
        }
      },
      /* @__PURE__ */ import_react60.default.createElement(
        Row_default,
        {
          justify: props.rightText !== void 0 ? "space-between" : "start",
          align: "center",
          suppressTopBottomMargin: true
        },
        /* @__PURE__ */ import_react60.default.createElement(Col_default, { offset: 1 }, /* @__PURE__ */ import_react60.default.createElement(
          "input",
          {
            name: "input",
            type: "checkbox",
            checked: props.toggled
          }
        )),
        /* @__PURE__ */ import_react60.default.createElement(Col_default, { span: 14 }, /* @__PURE__ */ import_react60.default.createElement("span", { title: (_a = props.title) == null ? void 0 : _a.toString() }, props.title)),
        props.rightText && /* @__PURE__ */ import_react60.default.createElement(Col_default, { span: 7, offset: 1 }, props.rightText)
      )
    );
  };
  var MultiToggleItem_default = MultiToggleItem;

  // src/components/taskpanes/ControlPanel/ValuesTab/ValuesTab.tsx
  var UniqueValueSortType = /* @__PURE__ */ ((UniqueValueSortType2) => {
    UniqueValueSortType2["ASCENDING_ALPHABETICAL"] = "Ascending Value";
    UniqueValueSortType2["DESCENDING_ALPHABETICAL"] = "Descending Value";
    UniqueValueSortType2["ASCENDING_PERCENT_OCCURENCE"] = "Ascending Occurence";
    UniqueValueSortType2["DESCENDING_PERCENT_OCCURENCE"] = "Descending Occurence";
    return UniqueValueSortType2;
  })(UniqueValueSortType || {});
  var sortUniqueValueCounts = (uniqueValueCounts, uniqueValueSortType) => {
    if (uniqueValueSortType === "Ascending Value" /* ASCENDING_ALPHABETICAL */) {
      return uniqueValueCounts.sort(function(a, b) {
        if (a.value < b.value) {
          return -1;
        }
        if (a.value > b.value) {
          return 1;
        }
        return 0;
      });
    } else if (uniqueValueSortType === "Descending Value" /* DESCENDING_ALPHABETICAL */) {
      return uniqueValueCounts.sort(function(a, b) {
        if (a.value > b.value) {
          return -1;
        }
        if (a.value < b.value) {
          return 1;
        }
        return 0;
      });
    } else if (uniqueValueSortType === "Ascending Occurence" /* ASCENDING_PERCENT_OCCURENCE */) {
      return uniqueValueCounts.sort(function(a, b) {
        return a.percentOccurence - b.percentOccurence;
      });
    } else {
      return uniqueValueCounts.sort(function(a, b) {
        return b.percentOccurence - a.percentOccurence;
      });
    }
  };
  function ValuesTab(props) {
    const [loading, setLoading] = (0, import_react61.useState)(true);
    const [isAllData, setIsAllData] = (0, import_react61.useState)(false);
    const [uniqueValueCounts, setUniqueValueCounts] = (0, import_react61.useState)([]);
    const [searchString, setSearchString] = (0, import_react61.useState)("");
    const [sort, setSort] = (0, import_react61.useState)("Ascending Value" /* ASCENDING_ALPHABETICAL */);
    const lastSearchTerm = (0, import_react61.useRef)("so it rerenders the first time");
    const lastSort = (0, import_react61.useRef)(sort);
    useDebouncedEffect(() => {
      if (!isAllData || isAllData && (!searchString.startsWith(lastSearchTerm.current) || searchString.length < lastSearchTerm.current.length)) {
        void loadUniqueValueCounts();
      }
      lastSearchTerm.current = searchString;
      lastSort.current = sort;
    }, [searchString, sort], 500);
    async function loadUniqueValueCounts() {
      setLoading(true);
      const _uniqueValueObj = await props.mitoAPI.getUniqueValueCounts(
        props.selectedSheetIndex,
        props.columnID,
        searchString,
        sort
      );
      if (_uniqueValueObj !== void 0) {
        const _uniqueValueObjs = _uniqueValueObj.uniqueValueCounts;
        const allDoesNotContainsFilters = getAllDoesNotContainsFilterValues(props.filters, props.columnDtype);
        allDoesNotContainsFilters.forEach((key2) => {
          _uniqueValueObjs.push({
            value: key2,
            percentOccurence: 0,
            countOccurence: 0,
            isNotFiltered: false
          });
        });
        setUniqueValueCounts(_uniqueValueObjs);
        setIsAllData(_uniqueValueObj.isAllData);
      } else {
        setUniqueValueCounts([]);
      }
      setLoading(false);
    }
    const getUniqueValueCountIndexFromSortedIndex = (index) => {
      const value = sortedUniqueValueCounts[index].value;
      return uniqueValueCounts.findIndex((uniqueValueCount) => {
        return uniqueValueCount.value === value;
      });
    };
    const toggleExclusiveFilters = (values) => {
      props.setFilters((prevFilters) => {
        let newFilters = [...prevFilters];
        values.forEach((value) => {
          const exclusiveFilter = getExclusiveFilterData(props.columnDtype, value);
          const originalFilterLength = newFilters.length;
          newFilters = newFilters.filter((filter) => {
            return isFilterGroup(filter) || !areFiltersEqual(filter, exclusiveFilter);
          });
          if (newFilters.length === originalFilterLength) {
            newFilters.push(exclusiveFilter);
          }
        });
        return newFilters;
      });
    };
    const sortedUniqueValueCounts = sortUniqueValueCounts(uniqueValueCounts, sort);
    const disabledMessage = getFilterDisabledMessage(props.columnDtype);
    return /* @__PURE__ */ import_react61.default.createElement(import_react61.Fragment, null, /* @__PURE__ */ import_react61.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react61.default.createElement(Col_default, { flex: "1", offsetRight: 1 }, /* @__PURE__ */ import_react61.default.createElement("p", { className: "text-header-2" }, "Unique Values")), /* @__PURE__ */ import_react61.default.createElement(Col_default, null, /* @__PURE__ */ import_react61.default.createElement(
      Select_default,
      {
        value: sort,
        onChange: (newSortType) => {
          setSort(newSortType);
        },
        width: "medium",
        dropdownWidth: "medium"
      },
      Object.values(UniqueValueSortType).map((sortType) => {
        return /* @__PURE__ */ import_react61.default.createElement(
          DropdownItem_default,
          {
            key: sortType,
            title: sortType
          }
        );
      })
    ))), /* @__PURE__ */ import_react61.default.createElement("div", { style: { height: "calc(100% - 40px)" } }, /* @__PURE__ */ import_react61.default.createElement(
      MultiToggleBox_default,
      {
        loading,
        searchable: true,
        searchState: {
          searchString,
          setSearchString
        },
        isSubset: !isAllData,
        message: disabledMessage,
        disabled: disabledMessage !== void 0
      },
      sortedUniqueValueCounts.map((uniqueValueCount, index) => {
        const valueToDisplay = formatCellData(uniqueValueCount.value, props.columnDtype, props.columnFormat);
        if (valueToDisplay === "NaN") {
          return /* @__PURE__ */ import_react61.default.createElement(
            MultiToggleItem_default,
            {
              key: index,
              title: /* @__PURE__ */ import_react61.default.createElement("span", null, valueToDisplay, " ", /* @__PURE__ */ import_react61.default.createElement(OpenFillNaN_default, { setUIState: props.setUIState, columnID: props.columnID })),
              rightText: uniqueValueCount.countOccurence + " (" + uniqueValueCount.percentOccurence.toFixed(2).toString() + "%)",
              toggled: uniqueValueCount.isNotFiltered,
              index,
              onToggle: () => {
                const uniqueValueCountIndex = getUniqueValueCountIndexFromSortedIndex(index);
                setUniqueValueCounts((oldUniqueValueCounts) => {
                  const newUniqueValueCounts = oldUniqueValueCounts.slice();
                  newUniqueValueCounts[uniqueValueCountIndex].isNotFiltered = !uniqueValueCounts[uniqueValueCountIndex].isNotFiltered;
                  return newUniqueValueCounts;
                });
                toggleExclusiveFilters([uniqueValueCount.value]);
              }
            }
          );
        }
        return /* @__PURE__ */ import_react61.default.createElement(
          MultiToggleItem_default,
          {
            key: index,
            title: valueToDisplay,
            rightText: uniqueValueCount.countOccurence + " (" + uniqueValueCount.percentOccurence.toFixed(2).toString() + "%)",
            toggled: uniqueValueCount.isNotFiltered,
            index,
            onToggle: () => {
              const uniqueValueCountIndex = getUniqueValueCountIndexFromSortedIndex(index);
              setUniqueValueCounts((oldUniqueValueCounts) => {
                const newUniqueValueCounts = oldUniqueValueCounts.slice();
                newUniqueValueCounts[uniqueValueCountIndex].isNotFiltered = !uniqueValueCounts[uniqueValueCountIndex].isNotFiltered;
                return newUniqueValueCounts;
              });
              toggleExclusiveFilters([uniqueValueCount.value]);
            }
          }
        );
      })
    )));
  }

  // src/components/taskpanes/ControlPanel/FilterAndSortTab/FormatCard.tsx
  var import_react62 = __toESM(require_react());
  var FORMAT_DESCRIPTION = "Format the selected column as a percent, choose the number of decimals, etc. This only changes the display of the column, and does not effect the underlying dataframe.";
  function FormatCard(props) {
    var _a;
    const formatTypeTitle = getFormatTitle((_a = props.sheetData) == null ? void 0 : _a.dfFormat.columns[props.columnID]);
    if (!isNumberDtype(props.columnDtype)) {
      return /* @__PURE__ */ import_react62.default.createElement(import_react62.default.Fragment, null);
    }
    return /* @__PURE__ */ import_react62.default.createElement(import_react62.default.Fragment, null, /* @__PURE__ */ import_react62.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react62.default.createElement(Col_default, { span: 4, title: FORMAT_DESCRIPTION }, /* @__PURE__ */ import_react62.default.createElement("p", { className: "text-header-3", title: "" }, "Num Type")), /* @__PURE__ */ import_react62.default.createElement(Col_default, { offset: 2, flex: "1" }, isNumberDtype(props.columnDtype) && /* @__PURE__ */ import_react62.default.createElement(
      Select_default,
      {
        value: formatTypeTitle
      },
      getColumnFormatDropdownItems(props.gridState.sheetIndex, props.sheetData, [props.columnID], props.mitoAPI)
    ), !isNumberDtype(props.columnDtype) && /* @__PURE__ */ import_react62.default.createElement("p", { className: "text-header-3 text-align-right" }, formatTypeTitle))));
  }
  var FormatCard_default = FormatCard;

  // src/components/taskpanes/DefaultTaskpane/DefaultTaskpaneFooter.tsx
  var import_react63 = __toESM(require_react());
  var DefaultTaskpaneFooter = (props) => {
    return /* @__PURE__ */ import_react63.default.createElement("div", { style: props.ignoreTaskpanePadding ? { margin: " 0px -10px -7px -10px" } : void 0 }, "  ", props.children);
  };
  var DefaultTaskpaneFooter_default = DefaultTaskpaneFooter;

  // src/components/taskpanes/ControlPanel/ControlPanelTaskpane.tsx
  var FILTER_MESSAGE_DELAY = 500;
  var ControlPanelTaskpane = (props) => {
    var _a, _b;
    const { columnHeader, columnID, columnFilters, columnDtype, columnFormat } = getCellDataFromCellIndexes(props.sheetData, props.selection.startingRowIndex, props.selection.startingColumnIndex);
    const [filters, _setFilters] = (0, import_react64.useState)(columnFilters !== void 0 ? columnFilters.filters : []);
    const [operator, setOperator] = (0, import_react64.useState)(columnFilters !== void 0 ? columnFilters.operator : "And");
    const [updateNumber, setUpdateNumber] = (0, import_react64.useState)(0);
    const [stepID, setStepID] = (0, import_react64.useState)("");
    const setFilters = (0, import_react64.useCallback)(
      (args) => {
        _setFilters(args);
        setUpdateNumber((old) => old + 1);
      },
      []
    );
    const [originalNumRows] = (0, import_react64.useState)(((_a = props.sheetData) == null ? void 0 : _a.numRows) || 0);
    const [editedFilter, setEditedFilter] = (0, import_react64.useState)(false);
    useDebouncedEffect(() => {
      if (updateNumber != 0) {
        void _sendFilterUpdateMessage();
      }
    }, [updateNumber], FILTER_MESSAGE_DELAY);
    useEffectOnUpdateEvent(() => {
      _setFilters((prevFilters) => {
        return (columnFilters == null ? void 0 : columnFilters.filters) || prevFilters;
      });
    }, props.analysisData);
    if (columnHeader === void 0 || columnID === void 0 || columnDtype == void 0) {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: { type: "none" /* NONE */ }
        });
      });
      return /* @__PURE__ */ import_react64.default.createElement(import_react64.default.Fragment, null);
    }
    const _sendFilterUpdateMessage = async () => {
      const filtersToApply = getFiltersToApply(filters, columnDtype);
      if (filtersToApply.length === 0 && (columnFilters !== void 0 && columnFilters.filters.length === 0)) {
        return;
      }
      const _stepID = await props.mitoAPI.editFilter(
        props.selectedSheetIndex,
        columnID,
        filtersToApply,
        operator,
        props.tab,
        stepID
      );
      setEditedFilter(true);
      setStepID(_stepID);
    };
    return /* @__PURE__ */ import_react64.default.createElement(import_react64.default.Fragment, null, /* @__PURE__ */ import_react64.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react64.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: getDisplayColumnHeader(columnHeader),
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react64.default.createElement(DefaultTaskpaneBody_default, null, props.tab === "filter_sort" /* FilterSort */ && /* @__PURE__ */ import_react64.default.createElement(import_react64.default.Fragment, null, /* @__PURE__ */ import_react64.default.createElement(
      DtypeCard_default,
      {
        selectedSheetIndex: props.selectedSheetIndex,
        columnID,
        columnDtype,
        mitoAPI: props.mitoAPI,
        lastStepIndex: props.lastStepIndex,
        lastStepType: props.lastStepType
      }
    ), /* @__PURE__ */ import_react64.default.createElement(
      FormatCard_default,
      {
        columnID,
        mitoAPI: props.mitoAPI,
        gridState: props.gridState,
        columnDtype,
        sheetData: props.sheetData
      }
    ), /* @__PURE__ */ import_react64.default.createElement(
      SortCard_default,
      {
        selectedSheetIndex: props.selectedSheetIndex,
        columnID,
        mitoAPI: props.mitoAPI,
        analysisData: props.analysisData
      }
    ), /* @__PURE__ */ import_react64.default.createElement(
      FilterCard_default,
      {
        selectedSheetIndex: props.selectedSheetIndex,
        columnID,
        filters,
        setFilters,
        setOperator,
        columnDtype,
        operator,
        mitoAPI: props.mitoAPI,
        rowDifference: originalNumRows - (((_b = props.sheetData) == null ? void 0 : _b.numRows) || 0),
        editedFilter
      }
    )), props.tab === "unique_values" /* UniqueValues */ && /* @__PURE__ */ import_react64.default.createElement(import_react64.default.Fragment, null, /* @__PURE__ */ import_react64.default.createElement(
      ValuesTab,
      {
        selectedSheetIndex: props.selectedSheetIndex,
        columnID,
        filters,
        setFilters,
        mitoAPI: props.mitoAPI,
        columnDtype,
        columnFormat,
        setUIState: props.setUIState
      }
    )), props.tab === "summary_stats" /* SummaryStats */ && /* @__PURE__ */ import_react64.default.createElement(import_react64.default.Fragment, null, /* @__PURE__ */ import_react64.default.createElement(
      ColumnSummaryGraph_default,
      {
        selectedSheetIndex: props.selectedSheetIndex,
        columnID,
        mitoAPI: props.mitoAPI
      }
    ), /* @__PURE__ */ import_react64.default.createElement(
      ColumnSummaryStatistics_default,
      {
        selectedSheetIndex: props.selectedSheetIndex,
        columnID,
        mitoAPI: props.mitoAPI,
        columnDtype,
        columnFormat,
        setUIState: props.setUIState
      }
    ))), /* @__PURE__ */ import_react64.default.createElement(DefaultTaskpaneFooter_default, { ignoreTaskpanePadding: true }, /* @__PURE__ */ import_react64.default.createElement(
      ControlPanelTaskpaneTabs_default,
      {
        selectedTab: props.tab,
        setUIState: props.setUIState,
        mitoAPI: props.mitoAPI
      }
    ))));
  };
  var ControlPanelTaskpane_default = ControlPanelTaskpane;

  // src/components/endo/ColumnHeaderDropdown.tsx
  var import_react65 = __toESM(require_react());
  function ColumnHeaderDropdown(props) {
    (0, import_react65.useEffect)(() => {
      if (props.display) {
        void props.mitoAPI.log("opened_column_header_dropdown");
      }
    }, [props.display]);
    const rowIndex = 0;
    const columnIndex = Object.keys(props.sheetData.columnIDsMap).indexOf(props.columnID);
    return /* @__PURE__ */ import_react65.default.createElement(
      Dropdown_default,
      {
        display: props.display,
        closeDropdown: () => props.setOpenColumnHeaderDropdown(false),
        width: "medium"
      },
      /* @__PURE__ */ import_react65.default.createElement(
        DropdownItem_default,
        {
          title: "Delete Column",
          onClick: () => {
            props.closeOpenEditingPopups();
            const columnIndexesSelected = getColumnIndexesInSelections(props.gridState.selections);
            const columnIDsToDelete = columnIndexesSelected.map((colIdx) => {
              var _a, _b;
              return ((_b = (_a = props.sheetData) == null ? void 0 : _a.data[colIdx]) == null ? void 0 : _b.columnID) || "";
            }).filter((columnID) => columnID !== "");
            void props.mitoAPI.editDeleteColumn(props.sheetIndex, columnIDsToDelete);
          }
        }
      ),
      /* @__PURE__ */ import_react65.default.createElement(
        DropdownItem_default,
        {
          title: "Rename Column",
          onClick: () => {
            props.openColumnHeaderEditor();
          },
          supressFocusSettingOnClose: true
        }
      ),
      /* @__PURE__ */ import_react65.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ import_react65.default.createElement(
        DropdownItem_default,
        {
          title: "Filter",
          onClick: () => {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ },
                selectedColumnControlPanelTab: "filter_sort" /* FilterSort */
              });
            });
          }
        }
      ),
      /* @__PURE__ */ import_react65.default.createElement(
        DropdownItem_default,
        {
          title: "Sort",
          onClick: () => {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ },
                selectedColumnControlPanelTab: "filter_sort" /* FilterSort */
              });
            });
          }
        }
      ),
      /* @__PURE__ */ import_react65.default.createElement(
        DropdownItem_default,
        {
          title: "Change Dtype",
          onClick: () => {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ },
                selectedColumnControlPanelTab: "filter_sort" /* FilterSort */
              });
            });
          }
        }
      ),
      /* @__PURE__ */ import_react65.default.createElement(
        DropdownItem_default,
        {
          title: "Fill NaN Values",
          onClick: () => {
            const columnIndexesSelected = getColumnIndexesInSelections(props.gridState.selections);
            const columnIDsToFillNaN = columnIndexesSelected.map((colIdx) => {
              var _a, _b;
              return ((_b = (_a = props.sheetData) == null ? void 0 : _a.data[colIdx]) == null ? void 0 : _b.columnID) || "";
            }).filter((columnID) => columnID !== "");
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: { type: "fill_na" /* FILL_NA */, startingColumnIDs: columnIDsToFillNaN }
              });
            });
          }
        }
      ),
      /* @__PURE__ */ import_react65.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ import_react65.default.createElement(
        DropdownItem_default,
        {
          title: "Format",
          onClick: () => {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ },
                selectedColumnControlPanelTab: "filter_sort" /* FilterSort */
              });
            });
          },
          disabled: !isNumberDtype(props.columnDtype),
          tooltip: !isNumberDtype(props.columnDtype) ? "Only number columns can be formatted currently" : void 0
        }
      ),
      /* @__PURE__ */ import_react65.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ import_react65.default.createElement(
        DropdownItem_default,
        {
          title: "Set Column Formula",
          onClick: () => {
            const { startingColumnFormula, arrowKeysScrollInFormula, editingMode } = getStartingFormula(props.sheetData, void 0, rowIndex, columnIndex);
            props.setEditorState({
              rowIndex: 0,
              columnIndex,
              formula: startingColumnFormula,
              arrowKeysScrollInFormula,
              editorLocation: "cell",
              editingMode
            });
          },
          supressFocusSettingOnClose: true
        }
      ),
      /* @__PURE__ */ import_react65.default.createElement(
        DropdownItem_default,
        {
          title: "Split Text to Columns",
          onClick: () => {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: { type: "split_text_to_columns" /* SPLIT_TEXT_TO_COLUMNS */, startingColumnID: props.columnID }
              });
            });
          }
        }
      ),
      /* @__PURE__ */ import_react65.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ import_react65.default.createElement(
        DropdownItem_default,
        {
          title: "View Unique Values",
          onClick: () => {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: {
                  type: "control_panel" /* CONTROL_PANEL */
                },
                selectedColumnControlPanelTab: "unique_values" /* UniqueValues */
              });
            });
          }
        }
      ),
      /* @__PURE__ */ import_react65.default.createElement(
        DropdownItem_default,
        {
          title: "View Summary Stats",
          onClick: () => {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: {
                  type: "control_panel" /* CONTROL_PANEL */
                },
                selectedColumnControlPanelTab: "summary_stats" /* SummaryStats */
              });
            });
          }
        }
      )
    );
  }

  // src/components/endo/ColumnHeader.tsx
  var HEADER_BACKGROUND_COLOR_DEFAULT = "#E8EBF8";
  var HEADER_TEXT_COLOR_DEFAULT = "#494650";
  var ColumnHeader = (props) => {
    var _a;
    const [openColumnHeaderDropdown, setOpenColumnHeaderDropdown] = (0, import_react66.useState)(false);
    const selected = getIsCellSelected(props.gridState.selections, -1, props.columnIndex);
    const width = props.gridState.widthDataArray[props.gridState.sheetIndex].widthArray[props.columnIndex];
    const { columnID, columnFilters, columnHeader, columnDtype, headerBackgroundColor, headerTextColor } = getCellDataFromCellIndexes(props.sheetData, -1, props.columnIndex);
    if (columnID === void 0 || columnFilters === void 0 || columnDtype == void 0 || columnHeader === void 0) {
      return /* @__PURE__ */ import_react66.default.createElement(import_react66.default.Fragment, null);
    }
    const hasFilters = columnFilters.filters.length > 0;
    const editingColumnHeader = props.editorState !== void 0 && props.editorState.editorLocation === "cell" && props.editorState.rowIndex <= -1 && props.editorState.columnIndex === props.columnIndex;
    const editingFinalColumnHeader = props.editorState !== void 0 && props.editorState.editorLocation === "cell" && props.editorState.rowIndex === -1 && props.editorState.columnIndex === props.columnIndex;
    const { lowerLevelColumnHeaders, finalColumnHeader } = getColumnHeaderParts(columnHeader);
    const borderStyle = getBorderStyle(props.gridState.selections, props.gridState.copiedSelections, -1, props.columnIndex, props.sheetData.numRows);
    const openColumnHeaderEditor = () => {
      props.setEditorState({
        rowIndex: -1,
        columnIndex: props.columnIndex,
        formula: getDisplayColumnHeader(finalColumnHeader),
        editorLocation: "cell",
        editingMode: "specific_index_labels"
      });
    };
    const closeColumnHeaderEditor = () => {
      props.setEditorState(void 0);
      setTimeout(() => focusGrid(props.containerRef.current), 100);
    };
    const ColumnHeaderResizer = /* @__PURE__ */ import_react66.default.createElement(
      "div",
      {
        className: "column-header-resizer",
        onDragStart: (e) => {
          e.stopPropagation();
          e.dataTransfer.setData("operation", "resize");
          e.dataTransfer.setData("mito-col-index", props.columnIndex + "");
          props.setColumnHeaderOperation("resize");
        },
        onDragEnd: () => {
          props.setColumnHeaderOperation(void 0);
        },
        onMouseDown: (e) => {
          e.stopPropagation();
        },
        onMouseUp: (e) => {
          e.stopPropagation();
        },
        onClick: (e) => {
          e.stopPropagation();
        },
        draggable: "true",
        onDoubleClick: () => {
          const selectionsCopy = [...props.gridState.selections];
          const isColumnSelected = getIsCellSelected(selectionsCopy, -1, props.columnIndex);
          if (!isColumnSelected) {
            selectionsCopy.push({
              startingRowIndex: -1,
              endingRowIndex: -1,
              startingColumnIndex: props.columnIndex,
              endingColumnIndex: props.columnIndex
            });
          }
          const columnIndexes = getColumnIndexesInSelections(selectionsCopy);
          const widthData = getWidthArrayAtFullWidthForColumnIndexes(columnIndexes, props.gridState, props.sheetData);
          props.setGridState((prevGridState) => {
            return __spreadProps(__spreadValues({}, prevGridState), {
              selections: selectionsCopy,
              widthDataArray: widthData
            });
          });
        }
      }
    );
    return /* @__PURE__ */ import_react66.default.createElement(
      "div",
      {
        className: classNames(
          "column-header-container",
          "column-header-text",
          { "column-header-container-selected": selected }
        ),
        style: { color: headerTextColor || HEADER_TEXT_COLOR_DEFAULT, backgroundColor: headerBackgroundColor || HEADER_BACKGROUND_COLOR_DEFAULT },
        key: props.columnIndex,
        "mito-col-index": props.columnIndex + "",
        onDragStart: (e) => {
          e.dataTransfer.setData("operation", "reorder");
          e.dataTransfer.setData("mito-col-index", props.columnIndex + "");
          props.setColumnHeaderOperation("reorder");
        },
        onDragEnd: () => {
          props.setColumnHeaderOperation(void 0);
        },
        title: getDisplayColumnHeader(columnHeader),
        draggable: !editingColumnHeader ? "true" : "false",
        onContextMenu: (e) => {
          e.preventDefault();
          setOpenColumnHeaderDropdown(true);
        }
      },
      lowerLevelColumnHeaders.map((lowerLevelColumnHeader, levelIndex) => {
        var _a2;
        const rowIndex = -1 - (lowerLevelColumnHeaders.length - levelIndex);
        const editingLowerLevelColumnHeader = props.editorState !== void 0 && props.editorState.rowIndex === rowIndex && props.editorState.columnIndex === props.columnIndex;
        return /* @__PURE__ */ import_react66.default.createElement(
          "div",
          {
            className: "column-header-lower-level-container",
            key: levelIndex,
            "mito-row-index": rowIndex + "",
            "mito-col-index": props.columnIndex,
            style: {
              minHeight: DEFAULT_HEIGHT,
              borderLeft: borderStyle.borderLeft,
              borderRight: borderStyle.borderRight,
              borderTop: levelIndex === 0 ? borderStyle.borderTop : void 0,
              borderBottom: levelIndex < lowerLevelColumnHeaders.length - 1 ? DEFAULT_BORDER_STYLE : void 0
            }
          },
          !editingLowerLevelColumnHeader && /* @__PURE__ */ import_react66.default.createElement(
            "p",
            {
              className: "column-header-lower-level-text text-overflow-hide",
              style: {
                maxWidth: `${width - 25}px`
              },
              onDoubleClick: (e) => {
                e.stopPropagation();
                props.setEditorState({
                  rowIndex,
                  columnIndex: props.columnIndex,
                  formula: getDisplayColumnHeader(lowerLevelColumnHeader),
                  editorLocation: "cell",
                  editingMode: "specific_index_labels"
                });
              }
            },
            getDisplayColumnHeader(lowerLevelColumnHeader)
          ),
          editingLowerLevelColumnHeader && /* @__PURE__ */ import_react66.default.createElement(
            "form",
            {
              style: {
                width: `${width - 25}px`
              },
              onSubmit: async (e) => {
                var _a3;
                e.preventDefault();
                const newColumnHeader = ((_a3 = props.editorState) == null ? void 0 : _a3.formula) || getDisplayColumnHeader(finalColumnHeader);
                const oldColumnHeader = getDisplayColumnHeader(lowerLevelColumnHeader);
                if (newColumnHeader !== oldColumnHeader) {
                  void props.mitoAPI.editRenameColumn(
                    props.gridState.sheetIndex,
                    columnID,
                    newColumnHeader,
                    levelIndex
                  );
                  props.setUIState((prevUIState) => {
                    if (prevUIState.currOpenTaskpane.type !== "control_panel" /* CONTROL_PANEL */) {
                      return __spreadProps(__spreadValues({}, prevUIState), {
                        currOpenTaskpane: { type: "none" /* NONE */ }
                      });
                    }
                    return prevUIState;
                  });
                }
                closeColumnHeaderEditor();
              }
            },
            /* @__PURE__ */ import_react66.default.createElement(
              Input_default,
              {
                value: ((_a2 = props.editorState) == null ? void 0 : _a2.formula) || "",
                onChange: (e) => {
                  const newHeader = e.target.value;
                  props.setEditorState((prevEditorState) => {
                    if (prevEditorState === void 0)
                      return void 0;
                    return __spreadProps(__spreadValues({}, prevEditorState), {
                      formula: newHeader
                    });
                  });
                },
                onKeyDown: (e) => {
                  if (e.key === "Escape") {
                    closeColumnHeaderEditor();
                  }
                },
                autoFocus: true,
                width: "block"
              }
            )
          ),
          ColumnHeaderResizer
        );
      }),
      /* @__PURE__ */ import_react66.default.createElement(
        "div",
        {
          className: classNames("column-header-final-container", {
            "grabbable": props.columnHeaderOperation === "reorder"
          }),
          "mito-row-index": "-1",
          "mito-col-index": props.columnIndex,
          onClick: () => {
            if (editingFinalColumnHeader) {
              return;
            }
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                selectedColumnControlPanelTab: "filter_sort" /* FilterSort */,
                currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ }
              });
            });
          },
          style: {
            height: "100%",
            minHeight: "45px",
            width: `${width}px`,
            borderTop: lowerLevelColumnHeaders.length > 0 ? DEFAULT_BORDER_STYLE : borderStyle.borderTop,
            borderBottom: borderStyle.borderBottom,
            borderLeft: borderStyle.borderLeft,
            borderRight: borderStyle.borderRight
          }
        },
        !editingFinalColumnHeader && /* @__PURE__ */ import_react66.default.createElement(import_react66.default.Fragment, null, /* @__PURE__ */ import_react66.default.createElement(
          "div",
          {
            className: "column-header-final-text",
            onClick: (e) => {
              e.stopPropagation();
            },
            onDoubleClick: (e) => {
              e.stopPropagation();
              props.setEditorState({
                rowIndex: -1,
                columnIndex: props.columnIndex,
                formula: getDisplayColumnHeader(finalColumnHeader),
                editorLocation: "cell",
                editingMode: "specific_index_labels"
              });
            },
            key: props.columnIndex,
            tabIndex: -1
          },
          finalColumnHeader + ""
        ), /* @__PURE__ */ import_react66.default.createElement("div", { className: "column-header-final-right-side" }, /* @__PURE__ */ import_react66.default.createElement("div", { className: "column-header-final-icons", title: "Open the column control panel" }, /* @__PURE__ */ import_react66.default.createElement("span", { title: "Edit filters" }, !hasFilters && /* @__PURE__ */ import_react66.default.createElement("div", { className: "icon-color-changer-container" }, /* @__PURE__ */ import_react66.default.createElement("div", { className: "icon-hide-on-hover" }, /* @__PURE__ */ import_react66.default.createElement(FilterIcon, { purpleOrDark: "dark" })), /* @__PURE__ */ import_react66.default.createElement("div", { className: "icon-show-on-hover" }, /* @__PURE__ */ import_react66.default.createElement(FilterIcon, { purpleOrDark: "purple" }))), hasFilters && /* @__PURE__ */ import_react66.default.createElement(FilterIcon, { nonEmpty: true })), /* @__PURE__ */ import_react66.default.createElement("div", { className: "icon-color-changer-container" }, /* @__PURE__ */ import_react66.default.createElement("div", { className: "icon-hide-on-hover" }, getTypeIdentifier(columnDtype, "dark")), /* @__PURE__ */ import_react66.default.createElement("div", { className: "icon-show-on-hover" }, getTypeIdentifier(columnDtype, "purple")))), ColumnHeaderResizer)),
        editingFinalColumnHeader && /* @__PURE__ */ import_react66.default.createElement(
          "form",
          {
            className: "element-width-block",
            onSubmit: () => {
              submitRenameColumnHeader(columnHeader, finalColumnHeader, columnID, props.gridState.sheetIndex, props.editorState, props.setUIState, props.mitoAPI);
              closeColumnHeaderEditor();
            }
          },
          /* @__PURE__ */ import_react66.default.createElement(
            Input_default,
            {
              value: ((_a = props.editorState) == null ? void 0 : _a.formula) || "",
              onChange: (e) => {
                const newHeader = e.target.value;
                props.setEditorState((prevEditorState) => {
                  if (prevEditorState === void 0)
                    return void 0;
                  return __spreadProps(__spreadValues({}, prevEditorState), {
                    formula: newHeader
                  });
                });
              },
              onKeyDown: (e) => {
                if (e.key === "Escape") {
                  closeColumnHeaderEditor();
                }
              },
              onBlur: () => {
                void submitRenameColumnHeader(columnHeader, finalColumnHeader, columnID, props.gridState.sheetIndex, props.editorState, props.setUIState, props.mitoAPI);
                closeColumnHeaderEditor();
              },
              autoFocus: true,
              width: "block"
            }
          )
        )
      ),
      /* @__PURE__ */ import_react66.default.createElement(
        ColumnHeaderDropdown,
        {
          mitoAPI: props.mitoAPI,
          setOpenColumnHeaderDropdown,
          setUIState: props.setUIState,
          openColumnHeaderEditor,
          sheetIndex: props.gridState.sheetIndex,
          columnID,
          columnDtype,
          display: openColumnHeaderDropdown,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          setEditorState: props.setEditorState,
          sheetData: props.sheetData,
          gridState: props.gridState
        }
      )
    );
  };
  var ColumnHeader_default = import_react66.default.memo(ColumnHeader);

  // src/components/layout/Spacer.tsx
  var import_react67 = __toESM(require_react());
  var Spacer = (props) => {
    return /* @__PURE__ */ import_react67.default.createElement("div", { style: { marginTop: `${props.px}px` } });
  };
  var Spacer_default = Spacer;

  // src/pro/graph/LabelAndColor.tsx
  var import_react69 = __toESM(require_react());

  // src/components/elements/ColorInput.tsx
  var import_react68 = __toESM(require_react());
  var ColorInput = (props) => {
    return /* @__PURE__ */ import_react68.default.createElement(
      "input",
      {
        className: "color-input",
        type: "color",
        value: props.value,
        onChange: (e) => {
          props.onChange(e.target.value);
        }
      }
    );
  };
  var ColorInput_default = ColorInput;

  // src/pro/graph/LabelAndColor.tsx
  var LabelAndColor = (props) => {
    return /* @__PURE__ */ import_react69.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react69.default.createElement(Col_default, null, /* @__PURE__ */ import_react69.default.createElement("p", null, props.label)), /* @__PURE__ */ import_react69.default.createElement(
      ColorInput_default,
      {
        value: props.color,
        onChange: props.onChange
      }
    ));
  };
  var LabelAndColor_default = LabelAndColor;

  // src/pro/taskpanes/SetDataframeFormat/SuggestedStyles.tsx
  var import_react75 = __toESM(require_react());

  // src/components/icons/SuggestedStyle1Icon.tsx
  var import_react70 = __toESM(require_react());
  var SuggestedStyle1Icon = () => {
    return /* @__PURE__ */ import_react70.default.createElement("svg", { width: "58", height: "46", viewBox: "0 0 58 46", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react70.default.createElement("rect", { width: "56", height: "11", transform: "translate(1 1)", fill: "#E8EBF8" }), /* @__PURE__ */ import_react70.default.createElement("g", { opacity: "0.05" }, /* @__PURE__ */ import_react70.default.createElement("rect", { width: "56", height: "11", transform: "translate(1 12)", fill: "#494650" })), /* @__PURE__ */ import_react70.default.createElement("rect", { width: "56", height: "11", transform: "translate(1 23)", fill: "white" }), /* @__PURE__ */ import_react70.default.createElement("g", { opacity: "0.05" }, /* @__PURE__ */ import_react70.default.createElement("rect", { width: "56", height: "11", transform: "translate(1 34)", fill: "#494650" })), /* @__PURE__ */ import_react70.default.createElement("rect", { x: "0.5", y: "0.5", width: "57", height: "45", stroke: "#ACACAD" }));
  };
  var SuggestedStyle1Icon_default = SuggestedStyle1Icon;

  // src/components/icons/SuggestedStyle2Icon.tsx
  var import_react71 = __toESM(require_react());
  var SuggestedStyle2Icon = () => {
    return /* @__PURE__ */ import_react71.default.createElement("svg", { width: "59", height: "46", viewBox: "0 0 59 46", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react71.default.createElement("rect", { width: "56", height: "11", transform: "translate(1.5 1)", fill: "#ACACAD" }), /* @__PURE__ */ import_react71.default.createElement("rect", { width: "56", height: "11", transform: "translate(1.5 12)", fill: "#F5F5F5" }), /* @__PURE__ */ import_react71.default.createElement("rect", { width: "56", height: "11", transform: "translate(1.5 23)", fill: "white" }), /* @__PURE__ */ import_react71.default.createElement("rect", { width: "56", height: "11", transform: "translate(1.5 34)", fill: "#F5F5F5" }), /* @__PURE__ */ import_react71.default.createElement("rect", { x: "1", y: "0.5", width: "57", height: "45", stroke: "#ACACAD" }));
  };
  var SuggestedStyle2Icon_default = SuggestedStyle2Icon;

  // src/components/icons/SuggestedStyle3Icon.tsx
  var import_react72 = __toESM(require_react());
  var SuggestedStyle3Icon = () => {
    return /* @__PURE__ */ import_react72.default.createElement("svg", { width: "58", height: "46", viewBox: "0 0 58 46", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react72.default.createElement("rect", { width: "56", height: "11", transform: "translate(1 1)", fill: "#549D3A" }), /* @__PURE__ */ import_react72.default.createElement("rect", { width: "56", height: "11", transform: "translate(1 12)", fill: "#D0E3C9" }), /* @__PURE__ */ import_react72.default.createElement("rect", { width: "56", height: "11", transform: "translate(1 23)", fill: "white" }), /* @__PURE__ */ import_react72.default.createElement("rect", { width: "56", height: "11", transform: "translate(1 34)", fill: "#D0E3C9" }), /* @__PURE__ */ import_react72.default.createElement("rect", { x: "0.5", y: "0.5", width: "57", height: "45", stroke: "#ACACAD" }));
  };
  var SuggestedStyle3Icon_default = SuggestedStyle3Icon;

  // src/components/icons/SuggestedStyle4Icon.tsx
  var import_react73 = __toESM(require_react());
  var SuggestedStyle4Icon = () => {
    return /* @__PURE__ */ import_react73.default.createElement("svg", { width: "59", height: "46", viewBox: "0 0 59 46", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react73.default.createElement("rect", { width: "56", height: "11", transform: "translate(1.5 1)", fill: "#4D73BE" }), /* @__PURE__ */ import_react73.default.createElement("rect", { width: "56", height: "11", transform: "translate(1.5 12)", fill: "#DAE1F0" }), /* @__PURE__ */ import_react73.default.createElement("rect", { width: "56", height: "11", transform: "translate(1.5 23)", fill: "white" }), /* @__PURE__ */ import_react73.default.createElement("rect", { width: "56", height: "11", transform: "translate(1.5 34)", fill: "#DAE1F0" }), /* @__PURE__ */ import_react73.default.createElement("rect", { x: "1", y: "0.5", width: "57", height: "45", stroke: "#ACACAD" }));
  };
  var SuggestedStyle4Icon_default = SuggestedStyle4Icon;

  // src/components/icons/SuggestedStyle5Icon.tsx
  var import_react74 = __toESM(require_react());
  var SuggestedStyle5Icon = () => {
    return /* @__PURE__ */ import_react74.default.createElement("svg", { width: "58", height: "46", viewBox: "0 0 58 46", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react74.default.createElement("rect", { width: "56", height: "11", transform: "translate(1 1)", fill: "#BE4D4D" }), /* @__PURE__ */ import_react74.default.createElement("rect", { width: "56", height: "11", transform: "translate(1 12)", fill: "#F0DADA" }), /* @__PURE__ */ import_react74.default.createElement("rect", { width: "56", height: "11", transform: "translate(1 23)", fill: "white" }), /* @__PURE__ */ import_react74.default.createElement("rect", { width: "56", height: "11", transform: "translate(1 34)", fill: "#F0DADA" }), /* @__PURE__ */ import_react74.default.createElement("rect", { x: "0.5", y: "0.5", width: "57", height: "45", stroke: "#ACACAD" }));
  };
  var SuggestedStyle5Icon_default = SuggestedStyle5Icon;

  // src/pro/taskpanes/SetDataframeFormat/SuggestedStyles.tsx
  var SuggestedStyles = (props) => {
    return /* @__PURE__ */ import_react75.default.createElement(import_react75.default.Fragment, null, /* @__PURE__ */ import_react75.default.createElement(Row_default, null, /* @__PURE__ */ import_react75.default.createElement(Col_default, null, /* @__PURE__ */ import_react75.default.createElement("p", { className: "text-header-3" }, "Suggested Styles"))), /* @__PURE__ */ import_react75.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react75.default.createElement("div", { onClick: () => {
      props.updateDataframeFormatParams({
        headers: { color: void 0, backgroundColor: void 0 },
        rows: { even: { color: void 0, backgroundColor: void 0 }, odd: { color: void 0, backgroundColor: void 0 } },
        border: { borderStyle: void 0, borderColor: void 0 }
      });
    } }, /* @__PURE__ */ import_react75.default.createElement(SuggestedStyle1Icon_default, null)), /* @__PURE__ */ import_react75.default.createElement("div", { onClick: () => {
      props.updateDataframeFormatParams({
        headers: {
          color: HEADER_TEXT_COLOR_DEFAULT,
          backgroundColor: "#9B9B9D"
        },
        rows: { even: { color: EVEN_ROW_TEXT_COLOR_DEFAULT, backgroundColor: void 0 }, odd: { color: ODD_ROW_TEXT_COLOR_DEFAULT, backgroundColor: void 0 } },
        border: { borderStyle: void 0, borderColor: void 0 }
      });
    } }, /* @__PURE__ */ import_react75.default.createElement(SuggestedStyle2Icon_default, null)), /* @__PURE__ */ import_react75.default.createElement("div", { onClick: () => {
      props.updateDataframeFormatParams({
        headers: {
          color: "#FFFFFF",
          backgroundColor: "#549D3A"
        },
        rows: { even: { color: EVEN_ROW_TEXT_COLOR_DEFAULT, backgroundColor: "#D0E3C9" }, odd: { color: ODD_ROW_TEXT_COLOR_DEFAULT, backgroundColor: void 0 } },
        border: { borderStyle: void 0, borderColor: void 0 }
      });
    } }, /* @__PURE__ */ import_react75.default.createElement(SuggestedStyle3Icon_default, null)), /* @__PURE__ */ import_react75.default.createElement("div", { onClick: () => {
      props.updateDataframeFormatParams({
        headers: {
          color: "#FFFFFF",
          backgroundColor: "#4D73BE"
        },
        rows: { even: { color: EVEN_ROW_TEXT_COLOR_DEFAULT, backgroundColor: "#DAE1F0" }, odd: { color: ODD_ROW_TEXT_COLOR_DEFAULT, backgroundColor: void 0 } },
        border: { borderStyle: void 0, borderColor: void 0 }
      });
    } }, /* @__PURE__ */ import_react75.default.createElement(SuggestedStyle4Icon_default, null)), /* @__PURE__ */ import_react75.default.createElement("div", { onClick: () => {
      props.updateDataframeFormatParams({
        headers: {
          color: "#FFFFFF",
          backgroundColor: "#8F1B15"
        },
        rows: { even: { color: EVEN_ROW_TEXT_COLOR_DEFAULT, backgroundColor: "#F0DADA" }, odd: { color: ODD_ROW_TEXT_COLOR_DEFAULT, backgroundColor: void 0 } },
        border: { borderStyle: void 0, borderColor: void 0 }
      });
    } }, /* @__PURE__ */ import_react75.default.createElement(SuggestedStyle5Icon_default, null))));
  };
  var SuggestedStyles_default = SuggestedStyles;

  // src/pro/taskpanes/SetDataframeFormat/SetDataframeFormatTaskpane.tsx
  var BORDER_COLOR_DEFAULT = "#FFFFFF";
  var getDefaultDataframeFormat = () => {
    return { columns: {}, headers: {}, rows: { even: {}, odd: {} }, border: {}, conditional_formats: [] };
  };
  var getDefaultParams = (sheetDataArray2, sheetIndex) => {
    if (sheetDataArray2.length === 0 || sheetDataArray2[sheetIndex] === void 0) {
      return void 0;
    }
    return {
      sheet_index: sheetIndex,
      df_format: sheetDataArray2[sheetIndex].dfFormat || getDefaultDataframeFormat()
    };
  };
  var SetDataframeFormatTaskpane = (props) => {
    const { params, setParams, startNewStep } = useLiveUpdatingParams_default(
      () => getDefaultParams(props.sheetDataArray, props.selectedSheetIndex),
      "set_dataframe_format" /* SetDataframeFormat */,
      props.mitoAPI,
      props.analysisData,
      50
    );
    const sheetFormat = (props.sheetDataArray[(params == null ? void 0 : params.sheet_index) || 0] || {}).dfFormat;
    if (params === void 0 || sheetFormat === void 0) {
      return /* @__PURE__ */ import_react76.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    const updateDataframeFormatParams = (newParams) => {
      setParams((prevParams) => {
        return updateObjectWithPartialObject(prevParams, { df_format: newParams });
      });
    };
    return /* @__PURE__ */ import_react76.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react76.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Color Dataframe",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react76.default.createElement(
      DefaultTaskpaneBody_default,
      {
        userProfile: props.userProfile,
        requiresPro: true,
        requiresProMessage: "Setting the dataframe format is a Mito Pro feature. Please upgrade to use this feature."
      },
      /* @__PURE__ */ import_react76.default.createElement(
        DataframeSelect_default,
        {
          sheetDataArray: props.sheetDataArray,
          sheetIndex: params.sheet_index,
          onChange: (newSheetIndex) => {
            startNewStep();
            setParams((prevParams) => {
              const newParams = getDefaultParams(props.sheetDataArray, newSheetIndex);
              if (newParams) {
                return newParams;
              }
              return __spreadProps(__spreadValues({}, prevParams), {
                sheet_index: newSheetIndex
              });
            });
            props.setUIState((prevState) => {
              return __spreadProps(__spreadValues({}, prevState), {
                selectedSheetIndex: newSheetIndex
              });
            });
          }
        }
      ),
      /* @__PURE__ */ import_react76.default.createElement(SuggestedStyles_default, { updateDataframeFormatParams }),
      /* @__PURE__ */ import_react76.default.createElement(CollapsibleSection_default, { title: "Column Headers" }, /* @__PURE__ */ import_react76.default.createElement(
        LabelAndColor_default,
        {
          label: "Background Color",
          color: params.df_format.headers.backgroundColor || HEADER_BACKGROUND_COLOR_DEFAULT,
          onChange: (newColor) => {
            return updateDataframeFormatParams({ headers: { backgroundColor: newColor } });
          }
        }
      ), /* @__PURE__ */ import_react76.default.createElement(
        LabelAndColor_default,
        {
          label: "Text Color",
          color: params.df_format.headers.color || HEADER_TEXT_COLOR_DEFAULT,
          onChange: (newColor) => {
            return updateDataframeFormatParams({ headers: { color: newColor } });
          }
        }
      )),
      /* @__PURE__ */ import_react76.default.createElement(Spacer_default, { px: 10 }),
      /* @__PURE__ */ import_react76.default.createElement(CollapsibleSection_default, { title: "Rows" }, /* @__PURE__ */ import_react76.default.createElement(
        LabelAndColor_default,
        {
          label: "Even Row: Background Color",
          color: params.df_format.rows.even.backgroundColor || EVEN_ROW_BACKGROUND_COLOR_DEFAULT,
          onChange: (newColor) => {
            return updateDataframeFormatParams({ rows: { even: { backgroundColor: newColor } } });
          }
        }
      ), /* @__PURE__ */ import_react76.default.createElement(
        LabelAndColor_default,
        {
          label: "Even Row: Text Color",
          color: params.df_format.rows.even.color || EVEN_ROW_TEXT_COLOR_DEFAULT,
          onChange: (newColor) => {
            return updateDataframeFormatParams({ rows: { even: { color: newColor } } });
          }
        }
      ), /* @__PURE__ */ import_react76.default.createElement(
        LabelAndColor_default,
        {
          label: "Odd Row: Background Color",
          color: params.df_format.rows.odd.backgroundColor || ODD_ROW_BACKGROUND_COLOR_DEFAULT,
          onChange: (newColor) => {
            return updateDataframeFormatParams({ rows: { odd: { backgroundColor: newColor } } });
          }
        }
      ), /* @__PURE__ */ import_react76.default.createElement(
        LabelAndColor_default,
        {
          label: "Odd Row: Text Color",
          color: params.df_format.rows.odd.color || ODD_ROW_TEXT_COLOR_DEFAULT,
          onChange: (newColor) => {
            return updateDataframeFormatParams({ rows: { odd: { color: newColor } } });
          }
        }
      )),
      /* @__PURE__ */ import_react76.default.createElement(Spacer_default, { px: 10 }),
      /* @__PURE__ */ import_react76.default.createElement(CollapsibleSection_default, { title: "Dataframe Border" }, /* @__PURE__ */ import_react76.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react76.default.createElement(Col_default, null, /* @__PURE__ */ import_react76.default.createElement(LabelAndTooltip_default, { tooltip: "The border line will be displayed when the dataframe styling object is printed out.", textBody: true }, "Border Style")), /* @__PURE__ */ import_react76.default.createElement(Col_default, null), /* @__PURE__ */ import_react76.default.createElement(
        Select_default,
        {
          value: params.df_format.border.borderStyle || "none",
          width: "medium",
          onChange: (newBorderStyle) => {
            if (newBorderStyle === "none") {
              return updateDataframeFormatParams({ border: { borderStyle: void 0 } });
            }
            return updateDataframeFormatParams({ border: { borderStyle: newBorderStyle } });
          }
        },
        /* @__PURE__ */ import_react76.default.createElement(DropdownItem_default, { title: "none" }),
        /* @__PURE__ */ import_react76.default.createElement(DropdownItem_default, { title: "solid" }),
        /* @__PURE__ */ import_react76.default.createElement(DropdownItem_default, { title: "dashed" })
      )), /* @__PURE__ */ import_react76.default.createElement(
        LabelAndColor_default,
        {
          label: "Border Color",
          color: params.df_format.border.borderColor || BORDER_COLOR_DEFAULT,
          onChange: (newColor) => {
            return updateDataframeFormatParams({ border: { borderColor: newColor } });
          }
        }
      ))
    ));
  };
  var SetDataframeFormatTaskpane_default = SetDataframeFormatTaskpane;

  // src/pro/taskpanes/ConditionalFormatting/ConditionalFormattingCard.tsx
  var import_react81 = __toESM(require_react());

  // src/components/elements/ExpandableContentCard.tsx
  var import_react77 = __toESM(require_react());
  var ExpandableContentCard = (props) => {
    const XElement = /* @__PURE__ */ import_react77.default.createElement(Col_default, { title: "Delete conditional formatting rule" }, /* @__PURE__ */ import_react77.default.createElement(
      XIcon_default,
      {
        onClick: (e) => {
          e.stopPropagation();
          props.onDelete();
        }
      }
    ));
    if (!props.isExpanded) {
      return /* @__PURE__ */ import_react77.default.createElement("div", { className: "expandable-content-card", onClick: () => props.setExpanded(true) }, /* @__PURE__ */ import_react77.default.createElement(Row_default, { suppressTopBottomMargin: true, align: "center", justify: "start" }, props.icon !== void 0 && /* @__PURE__ */ import_react77.default.createElement(Col_default, { offsetRight: 1, title: props.iconTitle }, props.icon), /* @__PURE__ */ import_react77.default.createElement(Col_default, { span: 17.5 }, /* @__PURE__ */ import_react77.default.createElement("div", { className: "flex flex-column" }, /* @__PURE__ */ import_react77.default.createElement("p", { className: "text-body-1" }, props.title), /* @__PURE__ */ import_react77.default.createElement("p", { className: "text-body-2" }, props.subtitle))), props.icon === void 0 && /* @__PURE__ */ import_react77.default.createElement(Col_default, { offsetRight: 4 }), /* @__PURE__ */ import_react77.default.createElement(Col_default, null, /* @__PURE__ */ import_react77.default.createElement(Row_default, { align: "top", justify: "end", suppressTopBottomMargin: true }, /* @__PURE__ */ import_react77.default.createElement("div", { className: "mr-5px", title: "Expand" }, /* @__PURE__ */ import_react77.default.createElement(UpArrowIcon_default, null)), XElement))));
    } else {
      return /* @__PURE__ */ import_react77.default.createElement("div", { className: "expandable-content-card" }, /* @__PURE__ */ import_react77.default.createElement(Row_default, { justify: "space-between", onClick: () => props.setExpanded(false) }, /* @__PURE__ */ import_react77.default.createElement(Col_default, { span: 12 }, /* @__PURE__ */ import_react77.default.createElement("p", { className: "text-header-3" }, props.expandedTitle)), /* @__PURE__ */ import_react77.default.createElement(Row_default, { justify: "end" }, /* @__PURE__ */ import_react77.default.createElement("div", { className: "mr-5px", title: "Minimize" }, /* @__PURE__ */ import_react77.default.createElement(DownArrowIcon_default, null)), XElement)), props.children);
    }
  };
  var ExpandableContentCard_default = ExpandableContentCard;

  // src/components/elements/MultiToggleColumns.tsx
  var import_react78 = __toESM(require_react());
  var MultiToggleColumns = (props) => {
    var _a, _b;
    const columnIDsMap = ((_a = props.sheetData) == null ? void 0 : _a.columnIDsMap) || {};
    const columnIDsAndDtype = Object.entries(((_b = props.sheetData) == null ? void 0 : _b.columnDtypeMap) || {});
    const columnIDs = columnIDsAndDtype.map(([cid]) => {
      return cid;
    });
    return /* @__PURE__ */ import_react78.default.createElement(
      MultiToggleBox_default,
      {
        searchable: true,
        onToggleAll: (newSelectedIndexes) => {
          const newSelectedColumnIDs = newSelectedIndexes.map((index) => {
            return columnIDs[index];
          });
          props.onChange(newSelectedColumnIDs);
        },
        height: "medium"
      },
      columnIDsAndDtype.map(([columnID, columnDtype], index) => {
        const columnHeader = columnIDsMap[columnID];
        const toggle = props.selectedColumnIDs.includes(columnID);
        const disabled = props.disabledColumnIDs !== void 0 && props.disabledColumnIDs.includes(columnID) || props.getIsDisabledColumnID !== void 0 && props.getIsDisabledColumnID(columnID, columnHeader, columnDtype);
        const displayColumnHeader = props.getDisplayColumnHeaderOverride !== void 0 ? props.getDisplayColumnHeaderOverride(columnID, columnHeader) : getDisplayColumnHeader(columnHeader);
        return /* @__PURE__ */ import_react78.default.createElement(
          MultiToggleItem_default,
          {
            key: index,
            index,
            title: displayColumnHeader,
            rightText: getDtypeValue(columnDtype),
            toggled: toggle,
            onToggle: () => {
              const newSelectedColumnIds = [...props.selectedColumnIDs];
              toggleInArray(newSelectedColumnIds, columnID);
              props.onChange(newSelectedColumnIds);
            },
            disabled
          }
        );
      })
    );
  };
  var MultiToggleColumns_default = MultiToggleColumns;

  // src/components/icons/ConditionalFormatIcon.tsx
  var import_react79 = __toESM(require_react());
  var ConditionalFormatIcon = (props) => {
    return /* @__PURE__ */ import_react79.default.createElement("svg", { width: "47", height: "41", viewBox: "0 0 47 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react79.default.createElement("rect", { width: "47", height: "41", rx: "3", fill: props.backgroundColor }), /* @__PURE__ */ import_react79.default.createElement("path", { d: "M15.1855 16.2808L11.6553 26H10.2124L14.2773 15.3359H15.2075L15.1855 16.2808ZM18.1445 26L14.6069 16.2808L14.585 15.3359H15.5151L19.5947 26H18.1445ZM17.9614 22.0522V23.2095H11.9702V22.0522H17.9614ZM20.8105 14.75H22.1729V24.4619L22.0557 26H20.8105V14.75ZM27.5269 21.9717V22.1255C27.5269 22.7017 27.4585 23.2363 27.3218 23.7295C27.1851 24.2178 26.9849 24.6426 26.7212 25.0039C26.4575 25.3652 26.1353 25.646 25.7544 25.8462C25.3735 26.0464 24.9365 26.1465 24.4434 26.1465C23.9404 26.1465 23.4985 26.061 23.1177 25.8901C22.7417 25.7144 22.4243 25.4629 22.1655 25.1357C21.9067 24.8086 21.6992 24.4131 21.543 23.9492C21.3916 23.4854 21.2866 22.9629 21.228 22.3818V21.708C21.2866 21.1221 21.3916 20.5972 21.543 20.1333C21.6992 19.6694 21.9067 19.2739 22.1655 18.9468C22.4243 18.6147 22.7417 18.3633 23.1177 18.1924C23.4937 18.0166 23.9307 17.9287 24.4287 17.9287C24.9268 17.9287 25.3687 18.0264 25.7544 18.2217C26.1401 18.4121 26.4624 18.6855 26.7212 19.042C26.9849 19.3984 27.1851 19.8257 27.3218 20.3237C27.4585 20.8169 27.5269 21.3662 27.5269 21.9717ZM26.1646 22.1255V21.9717C26.1646 21.5762 26.1279 21.2051 26.0547 20.8584C25.9814 20.5068 25.8643 20.1992 25.7031 19.9355C25.542 19.667 25.3296 19.457 25.0659 19.3057C24.8022 19.1494 24.4775 19.0713 24.0918 19.0713C23.75 19.0713 23.4521 19.1299 23.1982 19.2471C22.9492 19.3643 22.7368 19.5229 22.561 19.7231C22.3853 19.9185 22.2412 20.1431 22.1289 20.397C22.0215 20.646 21.9409 20.9048 21.8872 21.1733V22.9385C21.9653 23.2803 22.0923 23.6099 22.2681 23.9272C22.4487 24.2397 22.688 24.4961 22.9858 24.6963C23.2886 24.8965 23.6621 24.9966 24.1064 24.9966C24.4727 24.9966 24.7852 24.9233 25.0439 24.7769C25.3076 24.6255 25.52 24.418 25.6812 24.1543C25.8472 23.8906 25.9692 23.5854 26.0474 23.2388C26.1255 22.8921 26.1646 22.521 26.1646 22.1255ZM32.4121 25.0332C32.7344 25.0332 33.0322 24.9673 33.3057 24.8354C33.5791 24.7036 33.8037 24.5229 33.9795 24.2935C34.1553 24.0591 34.2554 23.793 34.2798 23.4951H35.5688C35.5444 23.9639 35.3857 24.4009 35.0928 24.8062C34.8047 25.2065 34.4263 25.5312 33.9575 25.7803C33.4888 26.0244 32.9736 26.1465 32.4121 26.1465C31.8164 26.1465 31.2964 26.0415 30.8521 25.8315C30.4126 25.6216 30.0464 25.3335 29.7534 24.9673C29.4653 24.6011 29.248 24.1812 29.1016 23.7075C28.96 23.229 28.8892 22.7236 28.8892 22.1914V21.8838C28.8892 21.3516 28.96 20.8486 29.1016 20.375C29.248 19.8965 29.4653 19.4741 29.7534 19.1079C30.0464 18.7417 30.4126 18.4536 30.8521 18.2437C31.2964 18.0337 31.8164 17.9287 32.4121 17.9287C33.0322 17.9287 33.5742 18.0557 34.0381 18.3096C34.502 18.5586 34.8657 18.9004 35.1294 19.335C35.3979 19.7646 35.5444 20.2529 35.5688 20.7998H34.2798C34.2554 20.4727 34.1626 20.1772 34.0015 19.9136C33.8452 19.6499 33.6304 19.4399 33.3569 19.2837C33.0884 19.1226 32.7734 19.042 32.4121 19.042C31.9971 19.042 31.6479 19.125 31.3647 19.291C31.0864 19.4521 30.8643 19.6719 30.6982 19.9502C30.5371 20.2236 30.4199 20.5288 30.3467 20.8657C30.2783 21.1978 30.2441 21.5371 30.2441 21.8838V22.1914C30.2441 22.5381 30.2783 22.8799 30.3467 23.2168C30.415 23.5537 30.5298 23.8589 30.6909 24.1323C30.8569 24.4058 31.0791 24.6255 31.3574 24.7915C31.6406 24.9526 31.9922 25.0332 32.4121 25.0332Z", fill: props.color }));
  };
  var ConditionalFormatIcon_default = ConditionalFormatIcon;

  // src/components/icons/ConditionalFormatInvalidIcon.tsx
  var import_react80 = __toESM(require_react());
  var ConditionalFormatInvalidIcon = (props) => {
    return /* @__PURE__ */ import_react80.default.createElement("svg", { width: "47", height: "43", viewBox: "0 0 47 43", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react80.default.createElement("rect", { y: "2", width: "47", height: "41", rx: "3", fill: props.backgroundColor }), /* @__PURE__ */ import_react80.default.createElement("path", { d: "M15.1855 18.2808L11.6553 28H10.2124L14.2773 17.3359H15.2075L15.1855 18.2808ZM18.1445 28L14.6069 18.2808L14.585 17.3359H15.5151L19.5947 28H18.1445ZM17.9614 24.0522V25.2095H11.9702V24.0522H17.9614ZM20.8105 16.75H22.1729V26.4619L22.0557 28H20.8105V16.75ZM27.5269 23.9717V24.1255C27.5269 24.7017 27.4585 25.2363 27.3218 25.7295C27.1851 26.2178 26.9849 26.6426 26.7212 27.0039C26.4575 27.3652 26.1353 27.646 25.7544 27.8462C25.3735 28.0464 24.9365 28.1465 24.4434 28.1465C23.9404 28.1465 23.4985 28.061 23.1177 27.8901C22.7417 27.7144 22.4243 27.4629 22.1655 27.1357C21.9067 26.8086 21.6992 26.4131 21.543 25.9492C21.3916 25.4854 21.2866 24.9629 21.228 24.3818V23.708C21.2866 23.1221 21.3916 22.5972 21.543 22.1333C21.6992 21.6694 21.9067 21.2739 22.1655 20.9468C22.4243 20.6147 22.7417 20.3633 23.1177 20.1924C23.4937 20.0166 23.9307 19.9287 24.4287 19.9287C24.9268 19.9287 25.3687 20.0264 25.7544 20.2217C26.1401 20.4121 26.4624 20.6855 26.7212 21.042C26.9849 21.3984 27.1851 21.8257 27.3218 22.3237C27.4585 22.8169 27.5269 23.3662 27.5269 23.9717ZM26.1646 24.1255V23.9717C26.1646 23.5762 26.1279 23.2051 26.0547 22.8584C25.9814 22.5068 25.8643 22.1992 25.7031 21.9355C25.542 21.667 25.3296 21.457 25.0659 21.3057C24.8022 21.1494 24.4775 21.0713 24.0918 21.0713C23.75 21.0713 23.4521 21.1299 23.1982 21.2471C22.9492 21.3643 22.7368 21.5229 22.561 21.7231C22.3853 21.9185 22.2412 22.1431 22.1289 22.397C22.0215 22.646 21.9409 22.9048 21.8872 23.1733V24.9385C21.9653 25.2803 22.0923 25.6099 22.2681 25.9272C22.4487 26.2397 22.688 26.4961 22.9858 26.6963C23.2886 26.8965 23.6621 26.9966 24.1064 26.9966C24.4727 26.9966 24.7852 26.9233 25.0439 26.7769C25.3076 26.6255 25.52 26.418 25.6812 26.1543C25.8472 25.8906 25.9692 25.5854 26.0474 25.2388C26.1255 24.8921 26.1646 24.521 26.1646 24.1255ZM32.4121 27.0332C32.7344 27.0332 33.0322 26.9673 33.3057 26.8354C33.5791 26.7036 33.8037 26.5229 33.9795 26.2935C34.1553 26.0591 34.2554 25.793 34.2798 25.4951H35.5688C35.5444 25.9639 35.3857 26.4009 35.0928 26.8062C34.8047 27.2065 34.4263 27.5312 33.9575 27.7803C33.4888 28.0244 32.9736 28.1465 32.4121 28.1465C31.8164 28.1465 31.2964 28.0415 30.8521 27.8315C30.4126 27.6216 30.0464 27.3335 29.7534 26.9673C29.4653 26.6011 29.248 26.1812 29.1016 25.7075C28.96 25.229 28.8892 24.7236 28.8892 24.1914V23.8838C28.8892 23.3516 28.96 22.8486 29.1016 22.375C29.248 21.8965 29.4653 21.4741 29.7534 21.1079C30.0464 20.7417 30.4126 20.4536 30.8521 20.2437C31.2964 20.0337 31.8164 19.9287 32.4121 19.9287C33.0322 19.9287 33.5742 20.0557 34.0381 20.3096C34.502 20.5586 34.8657 20.9004 35.1294 21.335C35.3979 21.7646 35.5444 22.2529 35.5688 22.7998H34.2798C34.2554 22.4727 34.1626 22.1772 34.0015 21.9136C33.8452 21.6499 33.6304 21.4399 33.3569 21.2837C33.0884 21.1226 32.7734 21.042 32.4121 21.042C31.9971 21.042 31.6479 21.125 31.3647 21.291C31.0864 21.4521 30.8643 21.6719 30.6982 21.9502C30.5371 22.2236 30.4199 22.5288 30.3467 22.8657C30.2783 23.1978 30.2441 23.5371 30.2441 23.8838V24.1914C30.2441 24.5381 30.2783 24.8799 30.3467 25.2168C30.415 25.5537 30.5298 25.8589 30.6909 26.1323C30.8569 26.4058 31.0791 26.6255 31.3574 26.7915C31.6406 26.9526 31.9922 27.0332 32.4121 27.0332Z", fill: props.color }), /* @__PURE__ */ import_react80.default.createElement("rect", { x: "33", y: "2", width: "14", height: "13", rx: "2", fill: "#CF0000" }), /* @__PURE__ */ import_react80.default.createElement("path", { d: "M41.0518 3.75781L40.8994 10.2769H39.5918L39.4331 3.75781H41.0518ZM39.3887 12.2764C39.3887 12.0436 39.4648 11.849 39.6172 11.6924C39.7738 11.5316 39.9896 11.4512 40.2646 11.4512C40.5355 11.4512 40.7492 11.5316 40.9058 11.6924C41.0623 11.849 41.1406 12.0436 41.1406 12.2764C41.1406 12.5007 41.0623 12.6932 40.9058 12.854C40.7492 13.0106 40.5355 13.0889 40.2646 13.0889C39.9896 13.0889 39.7738 13.0106 39.6172 12.854C39.4648 12.6932 39.3887 12.5007 39.3887 12.2764Z", fill: "white" }));
  };
  var ConditionalFormatInvalidIcon_default = ConditionalFormatInvalidIcon;

  // src/pro/taskpanes/ConditionalFormatting/ConditionalFormattingCard.tsx
  var getColumnHeadersIncludedMessage = (sheetData, columnIDs) => {
    if (columnIDs.length === 0) {
      return /* @__PURE__ */ import_react81.default.createElement("p", null, "Applied to 0 columns.");
    }
    const columnHeaders = columnIDs.map((columnID) => sheetData.columnIDsMap[columnID]).filter((columnHeader) => columnHeader !== void 0);
    const [columnHeadersString, numOtherColumnHeaders] = getFirstCharactersOfColumnHeaders(columnHeaders, 15);
    if (numOtherColumnHeaders === 0) {
      return /* @__PURE__ */ import_react81.default.createElement("p", null, "Applied to ", /* @__PURE__ */ import_react81.default.createElement("span", { className: "text-color-gray-important" }, columnHeadersString), ".");
    } else {
      return /* @__PURE__ */ import_react81.default.createElement("p", null, "Applied to ", /* @__PURE__ */ import_react81.default.createElement("span", { className: "text-color-gray-important" }, columnHeadersString), " and ", /* @__PURE__ */ import_react81.default.createElement("span", { className: "text-color-gray-important" }, numOtherColumnHeaders), " others.");
    }
  };
  var getInvalidColumnHeadersMessage = (sheetData, invalidColumnIDs, filters) => {
    if (invalidColumnIDs.length === 0) {
      return null;
    }
    const allColumnIDs = Object.keys(sheetData.columnIDsMap);
    const sortedColumnIDs = invalidColumnIDs.sort((a, b) => {
      return allColumnIDs.indexOf(a) - allColumnIDs.indexOf(b);
    });
    const columnHeaders = sortedColumnIDs.map((columnID) => sheetData.columnIDsMap[columnID]).filter((columnHeader) => columnHeader !== void 0);
    const [columnHeadersString, numOtherColumnHeaders] = getFirstCharactersOfColumnHeaders(columnHeaders, 20);
    let likelyCauseOfInvalid = "This is likely due to incompatible dtypes.";
    if (filters.length === 1 && (Object.keys(NUMBER_SELECT_OPTIONS).includes(filters[0].condition) || (filters[0].condition === "most_frequent" || filters[0].condition === "least_frequent")) && filters[0].value === "") {
      likelyCauseOfInvalid = "Please enter a number in the condition input.";
    }
    if (numOtherColumnHeaders === 0) {
      return /* @__PURE__ */ import_react81.default.createElement("p", null, "This condition cannot be applied to ", /* @__PURE__ */ import_react81.default.createElement("span", { className: "text-color-error-important" }, columnHeadersString), ". ", likelyCauseOfInvalid);
    } else {
      return /* @__PURE__ */ import_react81.default.createElement("p", null, "This condition cannot be applied to ", /* @__PURE__ */ import_react81.default.createElement("span", { className: "text-color-error-important" }, columnHeadersString), " and ", /* @__PURE__ */ import_react81.default.createElement("span", { className: "text-color-error-important" }, numOtherColumnHeaders), " others. ", likelyCauseOfInvalid);
    }
  };
  var ConditionalFormattingCard = (props) => {
    var _a, _b, _c;
    const conditionalFormatIndex = props.df_format.conditional_formats.findIndex((format) => {
      return format.format_uuid === props.conditionalFormat.format_uuid;
    });
    const invalidColumnIDs = ((_a = props.sheetData.conditionalFormattingResult) == null ? void 0 : _a.invalid_conditional_formats[props.conditionalFormat.format_uuid]) || [];
    const invalidColumnIDMessage = getInvalidColumnHeadersMessage(props.sheetData, invalidColumnIDs, props.conditionalFormat.filters);
    const conditionText = capitalizeFirstLetter(ALL_SELECT_OPTIONS[(_b = props.conditionalFormat.filters[0]) == null ? void 0 : _b.condition]["long_name"] || "contains");
    const color = props.conditionalFormat.color || ODD_ROW_TEXT_COLOR_DEFAULT;
    const backgroundColor = props.conditionalFormat.backgroundColor || ODD_ROW_BACKGROUND_COLOR_DEFAULT;
    return /* @__PURE__ */ import_react81.default.createElement(
      ExpandableContentCard_default,
      {
        title: /* @__PURE__ */ import_react81.default.createElement(import_react81.default.Fragment, null, conditionText, " ", (_c = props.conditionalFormat.filters[0]) == null ? void 0 : _c.value),
        subtitle: /* @__PURE__ */ import_react81.default.createElement(import_react81.default.Fragment, null, getColumnHeadersIncludedMessage(props.sheetData, props.conditionalFormat.columnIDs)),
        expandedTitle: "Columns to format",
        isExpanded: props.openFormattingCardIndex === conditionalFormatIndex,
        setExpanded: (newIsExpanded) => {
          if (newIsExpanded) {
            props.setOpenFormattingCardIndex(conditionalFormatIndex);
          } else {
            props.setOpenFormattingCardIndex(-1);
          }
        },
        icon: /* @__PURE__ */ import_react81.default.createElement(import_react81.default.Fragment, null, invalidColumnIDs.length === 0 && /* @__PURE__ */ import_react81.default.createElement(
          ConditionalFormatIcon_default,
          {
            color,
            backgroundColor
          }
        ), invalidColumnIDs.length !== 0 && /* @__PURE__ */ import_react81.default.createElement(
          ConditionalFormatInvalidIcon_default,
          {
            color,
            backgroundColor
          }
        )),
        iconTitle: invalidColumnIDs.length !== 0 ? `This conditional format cannot be applied to ${invalidColumnIDs.length} column${invalidColumnIDs.length === 1 ? "" : "s"} that ${invalidColumnIDs.length === 1 ? "is" : "are"} selected. Please update the filters or selected columns to fix.` : "",
        onDelete: () => {
          const newConditionalFormats = [...props.df_format.conditional_formats];
          newConditionalFormats.splice(conditionalFormatIndex, 1);
          props.updateDataframeFormatParams(__spreadProps(__spreadValues({}, props.df_format), { conditional_formats: newConditionalFormats }));
        }
      },
      /* @__PURE__ */ import_react81.default.createElement(
        MultiToggleColumns_default,
        {
          sheetData: props.sheetData,
          selectedColumnIDs: props.conditionalFormat.columnIDs,
          onChange: (newSelectedColumnIDs) => {
            const newConditionalFormats = [...props.df_format.conditional_formats];
            newConditionalFormats[conditionalFormatIndex].columnIDs = newSelectedColumnIDs;
            props.updateDataframeFormatParams(__spreadProps(__spreadValues({}, props.df_format), { conditional_formats: newConditionalFormats }));
          },
          getDisplayColumnHeaderOverride: (columnID, columnHeader) => {
            const isInvalid = invalidColumnIDs.includes(columnID);
            return getDisplayColumnHeader(columnHeader) + (isInvalid ? " (invalid)" : "");
          },
          height: "medium"
        }
      ),
      invalidColumnIDMessage,
      /* @__PURE__ */ import_react81.default.createElement(
        Filter,
        {
          filter: props.conditionalFormat.filters[0],
          columnDtype: void 0,
          operator: "And",
          displayOperator: false,
          setFilter: (newFilter) => {
            const newConditionalFormats = [...props.df_format.conditional_formats];
            newConditionalFormats[conditionalFormatIndex].filters = [newFilter];
            props.updateDataframeFormatParams(__spreadProps(__spreadValues({}, props.df_format), { conditional_formats: newConditionalFormats }));
          },
          nameLength: "long_name"
        }
      ),
      /* @__PURE__ */ import_react81.default.createElement(
        LabelAndColor_default,
        {
          label: "Text Color",
          color,
          onChange: (newColor) => {
            const newConditionalFormats = [...props.df_format.conditional_formats];
            newConditionalFormats[conditionalFormatIndex].color = newColor;
            props.updateDataframeFormatParams(__spreadProps(__spreadValues({}, props.df_format), { conditional_formats: newConditionalFormats }));
          }
        }
      ),
      /* @__PURE__ */ import_react81.default.createElement(
        LabelAndColor_default,
        {
          label: "Background Color",
          color: backgroundColor,
          onChange: (newColor) => {
            const newConditionalFormats = [...props.df_format.conditional_formats];
            newConditionalFormats[conditionalFormatIndex].backgroundColor = newColor;
            props.updateDataframeFormatParams(__spreadProps(__spreadValues({}, props.df_format), { conditional_formats: newConditionalFormats }));
          }
        }
      )
    );
  };
  var ConditionalFormattingCard_default = ConditionalFormattingCard;

  // src/pro/taskpanes/ConditionalFormatting/ConditionalFormattingTaskpane.tsx
  var getDefaultParams2 = (sheetDataArray2, sheetIndex) => {
    if (sheetDataArray2.length === 0 || sheetDataArray2[sheetIndex] === void 0) {
      return void 0;
    }
    return {
      sheet_index: sheetIndex,
      df_format: sheetDataArray2[sheetIndex].dfFormat || getDefaultDataframeFormat()
    };
  };
  var getDefaultEmptyConditionalFormat = () => {
    return {
      format_uuid: getRandomId(),
      columnIDs: [],
      filters: [{ condition: "not_empty", value: "" }],
      color: void 0,
      backgroundColor: void 0
    };
  };
  var ConditionalFormattingTaskpane = (props) => {
    const { params, setParams } = useLiveUpdatingParams_default(
      () => getDefaultParams2(props.sheetDataArray, props.selectedSheetIndex),
      "set_dataframe_format" /* SetDataframeFormat */,
      props.mitoAPI,
      props.analysisData,
      50,
      {
        getBackendFromFrontend: (params2) => {
          const conditionalFormats2 = params2.df_format.conditional_formats.map((conditionalFormat) => {
            const newConditionalFormat = __spreadValues({}, conditionalFormat);
            const newFilters = newConditionalFormat.filters.map((filter) => {
              const newFilter = __spreadValues({}, filter);
              let newValue = newFilter.value;
              if (checkFilterShouldHaveNumberValue(newFilter)) {
                const valueAsNumber = parseFloat(newFilter.value);
                if (!isNaN(valueAsNumber)) {
                  newValue = valueAsNumber;
                }
              }
              newFilter.value = newValue;
              return newFilter;
            });
            return __spreadProps(__spreadValues({}, newConditionalFormat), {
              filters: newFilters
            });
          });
          return __spreadProps(__spreadValues({}, params2), {
            df_format: __spreadProps(__spreadValues({}, params2.df_format), {
              conditional_formats: conditionalFormats2
            })
          });
        },
        getFrontendFromBackend: (params2) => {
          return params2;
        }
      }
    );
    const [openFormattingCardIndex, setOpenFormattingCardIndex] = (0, import_react82.useState)(-1);
    if (params === void 0) {
      return /* @__PURE__ */ import_react82.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    const sheetData = props.sheetDataArray[params.sheet_index];
    const conditionalFormats = params.df_format.conditional_formats;
    const updateDataframeFormatParams = (newParams) => {
      setParams((prevParams) => {
        return updateObjectWithPartialObject(prevParams, { df_format: newParams });
      });
    };
    return /* @__PURE__ */ import_react82.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react82.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Conditional Formatting",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react82.default.createElement(
      DefaultTaskpaneBody_default,
      {
        userProfile: props.userProfile,
        requiresPro: true,
        requiresProMessage: "Conditional formatting is a Mito Pro feature. Please upgrade to use this feature."
      },
      /* @__PURE__ */ import_react82.default.createElement(
        DataframeSelect_default,
        {
          sheetDataArray: props.sheetDataArray,
          sheetIndex: params.sheet_index,
          onChange: (newSheetIndex) => {
            setParams((prevParams) => {
              const newParams = getDefaultParams2(props.sheetDataArray, newSheetIndex);
              if (newParams) {
                return newParams;
              }
              return __spreadProps(__spreadValues({}, prevParams), {
                sheet_index: newSheetIndex
              });
            });
            props.setUIState((prevState) => {
              return __spreadProps(__spreadValues({}, prevState), {
                selectedSheetIndex: newSheetIndex
              });
            });
          }
        }
      ),
      /* @__PURE__ */ import_react82.default.createElement(Row_default, null, /* @__PURE__ */ import_react82.default.createElement(Col_default, null, /* @__PURE__ */ import_react82.default.createElement("p", { className: "text-header-3" }, "Conditional Formats"), /* @__PURE__ */ import_react82.default.createElement("p", { className: "text-subtext-1 mb-10px" }, "Rules applied in order. Later formatting rules overwrite earlier rules."))),
      conditionalFormats.map((conditionalFormat, index) => {
        return /* @__PURE__ */ import_react82.default.createElement(
          ConditionalFormattingCard_default,
          {
            key: conditionalFormat.format_uuid + index,
            df_format: params.df_format,
            conditionalFormat,
            updateDataframeFormatParams,
            sheetData,
            openFormattingCardIndex,
            setOpenFormattingCardIndex
          }
        );
      }),
      /* @__PURE__ */ import_react82.default.createElement(Row_default, null, /* @__PURE__ */ import_react82.default.createElement(
        TextButton_default,
        {
          variant: "dark",
          onClick: () => {
            const newConditionalFormats = [...params.df_format.conditional_formats];
            newConditionalFormats.push(getDefaultEmptyConditionalFormat());
            return updateDataframeFormatParams({ conditional_formats: newConditionalFormats });
          }
        },
        "Add Conditional Formatting Rule"
      ))
    ));
  };
  var ConditionalFormattingTaskpane_default = ConditionalFormattingTaskpane;

  // src/data/documentationLinks.tsx
  var DOCUMENTATION_LINK_INSTALL = "https://docs.trymito.io/getting-started/installing-mito";
  var DOCUMENTATION_LINK_TUTORIAL = "https://docs.trymito.io/getting-started/tutorial";
  var DOCUMENTATION_LINK_SPREADSHEET_FORMULAS = "https://docs.trymito.io/how-to/interacting-with-your-data";
  var DISCORD_INVITE_LINK = "https://discord.gg/XdJSZyejJU";

  // src/utils/copy.tsx
  var getCopyStringForValue = (value, columnDtype, columnFormatType) => {
    if (isValueNone(value)) {
      return "";
    }
    return formatCellData(value, columnDtype, columnFormatType);
  };
  var getCopyStringForRow = (sheetData, rowIndex, lowColIndex, highColIndex) => {
    let copyString = "";
    for (let columnIndex = lowColIndex; columnIndex <= highColIndex; columnIndex++) {
      if (rowIndex === -1) {
        if (columnIndex === -1) {
        } else {
          copyString += getDisplayColumnHeader(sheetData.data[columnIndex].columnHeader);
        }
      } else {
        if (columnIndex === -1) {
          copyString += sheetData.index[rowIndex];
        } else {
          const columnID = getColumnIDByIndex(sheetData, columnIndex);
          copyString += getCopyStringForValue(
            sheetData.data[columnIndex].columnData[rowIndex],
            sheetData.data[columnIndex].columnDtype,
            sheetData.dfFormat.columns[columnID]
          );
        }
      }
      if (columnIndex !== highColIndex) {
        copyString += "	";
      }
    }
    return copyString;
  };
  var getSelectionsToCopy = (selections) => {
    const lowRowIndex = Math.min(selections[0].startingRowIndex, selections[0].endingRowIndex);
    const highRowIndex = Math.max(selections[0].startingRowIndex, selections[0].endingRowIndex);
    const finalSelections = [selections[0]];
    for (let i = 1; i < selections.length; i++) {
      const selection = selections[i];
      const selectionLowRowIndex = Math.min(selection.startingRowIndex, selection.endingRowIndex);
      const selectionHighRowIndex = Math.max(selection.startingRowIndex, selection.endingRowIndex);
      if (selectionLowRowIndex === lowRowIndex && selectionHighRowIndex === highRowIndex) {
        finalSelections.push(selection);
      } else {
        break;
      }
    }
    finalSelections.sort((selectionOne, selectionTwo) => {
      return selectionOne.startingColumnIndex - selectionTwo.startingColumnIndex;
    });
    return finalSelections;
  };
  var getCopyStringForSelections = (sheetData, selections) => {
    const lowRowIndex = Math.min(selections[0].startingRowIndex, selections[0].endingRowIndex);
    let highRowIndex = Math.max(selections[0].startingRowIndex, selections[0].endingRowIndex);
    if (lowRowIndex === -1 && highRowIndex === -1) {
      highRowIndex = Math.min(sheetData.numRows - 1, MAX_ROWS - 1);
    }
    let copyString = "";
    for (let rowIndex = lowRowIndex; rowIndex <= highRowIndex; rowIndex++) {
      selections.forEach((selection, selectionIndex) => {
        const lowColIndex = Math.min(selection.startingColumnIndex, selection.endingColumnIndex);
        let highColIndex = Math.max(selection.startingColumnIndex, selection.endingColumnIndex);
        if (lowColIndex === -1 && highColIndex === -1) {
          highColIndex = sheetData.numColumns - 1;
        }
        copyString += getCopyStringForRow(sheetData, rowIndex, lowColIndex, highColIndex);
        if (selectionIndex !== selections.length - 1) {
          copyString += "	";
        }
      });
      if (rowIndex !== highRowIndex) {
        copyString += "\n";
      }
    }
    return copyString;
  };
  var getCopyStringForClipboard = (sheetData, selections) => {
    if (sheetData === void 0 || selections.length === 0) {
      return void 0;
    }
    const selectionsToCopy = getSelectionsToCopy(selections);
    return [getCopyStringForSelections(sheetData, selectionsToCopy), selectionsToCopy];
  };
  var writeTextToClipboard = (text) => {
    if (navigator.clipboard && window.isSecureContext) {
      return navigator.clipboard.writeText(text);
    } else {
      const textArea = document.createElement("textarea");
      textArea.value = text;
      textArea.style.position = "absolute";
      textArea.style.opacity = "0";
      document.body.appendChild(textArea);
      const currentFocusedElement = document.activeElement;
      textArea.select();
      return new Promise((res, rej) => {
        document.execCommand("copy") ? res() : rej();
        textArea.remove();
        try {
          currentFocusedElement == null ? void 0 : currentFocusedElement.focus();
        } catch (e) {
          console.log("Error refocusing on element", e);
        }
      });
    }
  };

  // src/components/elements/GetSupportButton.tsx
  var import_react83 = __toESM(require_react());
  var DEFAULT_SUPPORT_EMAIL = "founders@sagacollab.com";
  var GetSupportButton = (props) => {
    return /* @__PURE__ */ import_react83.default.createElement(
      TextButton_default,
      {
        className: classNames(props.className, "cursor-pointer"),
        variant: "dark",
        width: props.width || "medium",
        href: props.userProfile.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL === DEFAULT_SUPPORT_EMAIL ? DISCORD_INVITE_LINK : `mailto:${props.userProfile.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL}?subject=Mito support request`,
        target: "_blank",
        onClick: () => {
          var _a;
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ }
            });
          });
          void ((_a = props.mitoAPI) == null ? void 0 : _a.log("clicked_get_support_button"));
          return true;
        }
      },
      "Get Support"
    );
  };
  var GetSupportButton_default = GetSupportButton;

  // src/utils/actions.tsx
  var getDefaultActionsDisabledMessage = (uiState, commCreationStatus) => {
    let defaultActionDisabledMessage = void 0;
    const disabledDueToReplayAnalysis = uiState.currOpenTaskpane.type === "UpdateImports" /* UPDATEIMPORTS */ && uiState.currOpenTaskpane.failedReplayData !== void 0;
    if (disabledDueToReplayAnalysis) {
      defaultActionDisabledMessage = "Please resolve issues with the failed replay analysis before making further edits.";
    } else if (commCreationStatus === "loading") {
      defaultActionDisabledMessage = "Mito is still trying to connect to the backend. Please wait a moment.";
    } else if (commCreationStatus === "non_working_extension_error") {
      defaultActionDisabledMessage = "Mito is installed incorrectly. Please fix your installation and try again.";
    } else if (commCreationStatus === "non_valid_location_error") {
      defaultActionDisabledMessage = "Mito does not currently support this location. Please use Mito in JupyerLab or Jupter Notebooks.";
    } else if (commCreationStatus === "no_backend_comm_registered_error") {
      defaultActionDisabledMessage = "Kernel has been restarted. Please rerun the cell that created this mitosheet.";
    }
    return defaultActionDisabledMessage;
  };
  var createActions = (sheetDataArray2, gridState, dfSources, closeOpenEditingPopups, setEditorState, uiState, setUIState, setGridState, mitoAPI, mitoContainerRef, analysisData2, userProfile2, commCreationStatus) => {
    const sheetIndex = gridState.sheetIndex;
    const sheetData = sheetDataArray2[sheetIndex];
    const dfFormat = (sheetData == null ? void 0 : sheetData.dfFormat) || getDefaultDataframeFormat();
    const startingRowIndex = gridState.selections[gridState.selections.length - 1].startingRowIndex;
    const startingColumnIndex = gridState.selections[gridState.selections.length - 1].startingColumnIndex;
    const { columnID } = getCellDataFromCellIndexes(sheetData, startingRowIndex, startingColumnIndex);
    const { startingColumnFormula, arrowKeysScrollInFormula } = getStartingFormula(sheetData, void 0, startingRowIndex, startingColumnIndex);
    const startingColumnID = columnID;
    const lastStepSummary = analysisData2.stepSummaryList[analysisData2.stepSummaryList.length - 1];
    const defaultActionDisabledMessage = getDefaultActionsDisabledMessage(uiState, commCreationStatus);
    const actions = {
      ["add column" /* Add_Column */]: {
        type: "add column" /* Add_Column */,
        shortTitle: "Add Col",
        longTitle: "Add column",
        actionFunction: () => {
          if (sheetDataArray2.length === 0) {
            return;
          }
          setEditorState(void 0);
          closeOpenEditingPopups();
          const newColumnHeader = "new-column-" + getNewColumnHeader();
          const newColumnHeaderIndex = gridState.selections[gridState.selections.length - 1].endingColumnIndex + 1;
          void mitoAPI.editAddColumn(
            sheetIndex,
            newColumnHeader,
            newColumnHeaderIndex
          );
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? defaultActionDisabledMessage : "There are no dataframes to add columns to. Import data.";
        },
        searchTerms: ["add column", "add col", "new column", "new col", "insert column", "insert col"],
        tooltip: "Add a new formula column to the right of your selection."
      },
      ["catch up" /* Catch_Up */]: {
        type: "catch up" /* Catch_Up */,
        shortTitle: "Catch Up",
        longTitle: "Catch up",
        actionFunction: () => {
          void mitoAPI.log("click_catch_up");
          void mitoAPI.updateCheckoutStepByIndex(-1);
        },
        isDisabled: () => {
          return analysisData2.currStepIdx === lastStepSummary.step_idx ? "You are on the most recent step, so there is nothing to catch up on." : void 0;
        },
        searchTerms: ["fast forward", "catch up"],
        tooltip: "Go to the current state of the analysis."
      },
      ["change dtype" /* Change_Dtype */]: {
        type: "change dtype" /* Change_Dtype */,
        shortTitle: "Dtype",
        longTitle: "Change column dtype",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              toolbarDropdown: "dtype"
            });
          });
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray2)) {
            return "There are no columns to change the dtype of. Import data.";
          }
          return defaultActionDisabledMessage;
        },
        searchTerms: ["change dtype", "dtype", "cast", "boolean", "string", "number", "float", "int", "datetime", "date", "timedelta"],
        tooltip: "Cast the dtype of your data column to a string, int, float, boolean, datetime, or timedelta."
      },
      ["clear" /* Clear */]: {
        type: "clear" /* Clear */,
        shortTitle: "Clear",
        longTitle: "Clear all edits",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "ClearAnalysis" /* ClearAnalysis */ },
              currOpenTaskpane: { type: "none" /* NONE */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["clear", "reset", "undo", "redo"],
        tooltip: "Removes all of the transformations you've made to imported dataframes."
      },
      ["column summary" /* Column_Summary */]: {
        type: "column summary" /* Column_Summary */,
        shortTitle: "Column Summary",
        longTitle: "View column summary statistics ",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ },
              selectedColumnControlPanelTab: "summary_stats" /* SummaryStats */,
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray2) ? defaultActionDisabledMessage : "There are no columns to summarize in the selected sheet. Add data to the sheet.";
        },
        searchTerms: ["column summary", "describe", "stats"],
        tooltip: "Learn about the distribution of the data in the selected column."
      },
      ["copy" /* Copy */]: {
        type: "copy" /* Copy */,
        shortTitle: "Copy",
        longTitle: "Copy",
        actionFunction: () => {
          closeOpenEditingPopups();
          const copyStringAndSelections = getCopyStringForClipboard(
            sheetData,
            gridState.selections
          );
          if (copyStringAndSelections === void 0) {
            return;
          }
          const [stringToCopy, copiedSelections] = copyStringAndSelections;
          void writeTextToClipboard(stringToCopy);
          setGridState((prevGridState) => {
            return __spreadProps(__spreadValues({}, prevGridState), {
              copiedSelections
            });
          });
          void mitoAPI.log("copied_data", {
            "num_selections": gridState.selections.length
          });
        },
        isDisabled: () => {
          return getDataframeIsSelected(uiState, sheetDataArray2) ? defaultActionDisabledMessage : "There is no selected data to copy.";
        },
        searchTerms: ["copy", "paste", "export"],
        tooltip: "Copy the current selection to the clipboard.",
        displayKeyboardShortcuts: {
          mac: "Cmd+C",
          windows: "Ctrl+C"
        }
      },
      ["delete column" /* Delete_Column */]: {
        type: "delete column" /* Delete_Column */,
        shortTitle: "Del Col",
        longTitle: "Delete columns",
        actionFunction: async () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          if (isSelectionsOnlyColumnHeaders(gridState.selections)) {
            const columnIndexesSelected = getColumnIndexesInSelections(gridState.selections);
            const columnIDsToDelete = columnIndexesSelected.map((colIdx) => {
              var _a;
              return ((_a = sheetData == null ? void 0 : sheetData.data[colIdx]) == null ? void 0 : _a.columnID) || "";
            }).filter((columnID2) => columnID2 !== "");
            if (columnIDsToDelete !== void 0) {
              await mitoAPI.editDeleteColumn(
                sheetIndex,
                columnIDsToDelete
              );
            }
          }
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray2)) {
            return "There are no columns to delete. Import data.";
          }
          if (doesColumnExist(startingColumnID, sheetIndex, sheetDataArray2)) {
            if (isSelectionsOnlyColumnHeaders(gridState.selections)) {
              return defaultActionDisabledMessage;
            } else {
              return "The selection contains individual cells. Click on column headers to select entire columns only.";
            }
          } else {
            return "There are no columns in the dataframe to delete. Add data to the sheet.";
          }
        },
        searchTerms: ["delete column", "delete col", "del col", "del column", "remove column", "remove col"],
        tooltip: "Delete all of the selected columns from the sheet."
      },
      ["delete dataframe" /* Delete_Dataframe */]: {
        type: "delete dataframe" /* Delete_Dataframe */,
        shortTitle: "Delete dataframe",
        longTitle: "Delete dataframe",
        actionFunction: async () => {
          if (sheetIndex !== 0) {
            setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                selectedSheetIndex: sheetIndex - 1
              });
            });
          }
          closeOpenEditingPopups();
          await mitoAPI.editDataframeDelete(sheetIndex);
        },
        isDisabled: () => {
          return getDataframeIsSelected(uiState, sheetDataArray2) ? defaultActionDisabledMessage : "There is no selected dataframe to delete.";
        },
        searchTerms: ["delete", "delete dataframe", "delete sheet", "del", "del dataframe", "del sheet", "remove", "remove dataframe", "remove sheet"],
        tooltip: "Delete the selected sheet."
      },
      ["delete graph" /* Delete_Graph */]: {
        type: "delete graph" /* Delete_Graph */,
        shortTitle: "Delete Graph",
        longTitle: "Delete graph",
        actionFunction: async () => {
          if (uiState.selectedGraphID) {
            await mitoAPI.editGraphDelete(uiState.selectedGraphID);
          }
        },
        isDisabled: () => {
          return getGraphIsSelected(uiState) ? defaultActionDisabledMessage : "There is no selected graph to delete.";
        },
        searchTerms: ["delete", "delete graph", "delete chart", "del", "del chart", "del chart", "remove", "remove chart", "remove graph"],
        tooltip: "Delete the selected graph."
      },
      ["delete row" /* Delete_Row */]: {
        type: "delete row" /* Delete_Row */,
        shortTitle: "Delete Row",
        longTitle: "Delete row",
        actionFunction: async () => {
          const rowsToDelete = getSelectedRowLabelsWithEntireSelectedRow(gridState.selections, sheetData);
          if (rowsToDelete.length > 0) {
            void mitoAPI.editDeleteRow(sheetIndex, rowsToDelete);
          }
        },
        isDisabled: () => {
          const rowsToDelete = getSelectedRowLabelsWithEntireSelectedRow(gridState.selections, sheetData);
          if (rowsToDelete.length > 0) {
            return defaultActionDisabledMessage;
          }
          return "There are no selected rows to delete.";
        },
        searchTerms: ["delete", "delete row", "filter rows", "rows", "remove rows", "hide rows"],
        tooltip: "Delete the selected rows."
      },
      ["docs" /* Docs */]: {
        type: "docs" /* Docs */,
        shortTitle: "Docs",
        longTitle: "Documentation",
        actionFunction: () => {
          setEditorState(void 0);
          void mitoAPI.log("clicked_documentation");
          window.open("https://docs.trymito.io/how-to/importing-data-to-mito", "_blank");
        },
        isDisabled: () => {
          return void 0;
        },
        searchTerms: ["docs", "documentation", "help", "support"],
        tooltip: "Documentation, tutorials, and how-tos on all functionality in Mito."
      },
      ["drop duplicates" /* Drop_Duplicates */]: {
        type: "drop duplicates" /* Drop_Duplicates */,
        shortTitle: "Dedup",
        longTitle: "Deduplicate dataframe",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "drop_duplicates" /* DROP_DUPLICATES */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? defaultActionDisabledMessage : "There are no dataframes to operate on. Import data.";
        },
        searchTerms: ["dedup", "deduplicate", "same", "remove", "drop duplicates", "duplicates"],
        tooltip: "Remove duplicated rows from your dataframe."
      },
      ["duplicate dataframe" /* Duplicate_Dataframe */]: {
        type: "duplicate dataframe" /* Duplicate_Dataframe */,
        shortTitle: "Duplicate Dataframe",
        longTitle: "Duplicate dataframe",
        actionFunction: async () => {
          setEditorState(void 0);
          await mitoAPI.editDataframeDuplicate(sheetIndex);
        },
        isDisabled: () => {
          return getDataframeIsSelected(uiState, sheetDataArray2) ? defaultActionDisabledMessage : "There is no selected dataframe to duplicate.";
        },
        searchTerms: ["duplicate", "copy"],
        tooltip: "Make a copy of the selected sheet."
      },
      ["duplicate graph" /* Duplicate_Graph */]: {
        type: "duplicate graph" /* Duplicate_Graph */,
        shortTitle: "Duplicate Graph",
        longTitle: "Duplicate selected graph",
        actionFunction: async () => {
          setEditorState(void 0);
          if (uiState.selectedGraphID) {
            const newGraphID = getRandomId();
            await mitoAPI.editGraphDuplicate(uiState.selectedGraphID, newGraphID);
          }
        },
        isDisabled: () => {
          return getGraphIsSelected(uiState) ? defaultActionDisabledMessage : "There is no selected graph to duplicate.";
        },
        searchTerms: ["duplicate", "copy", "graph"],
        tooltip: "Make a copy of the selected graph."
      },
      ["export" /* Export */]: {
        type: "export" /* Export */,
        shortTitle: "Download",
        longTitle: "Download File",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "download" /* DOWNLOAD */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? defaultActionDisabledMessage : "There are no dataframes to export. Import data.";
        },
        searchTerms: ["export", "download", "excel", "csv"],
        tooltip: "Download dataframes as a .csv or .xlsx file."
      },
      ["export dropdown" /* Export_Dropdown */]: {
        type: "export dropdown" /* Export_Dropdown */,
        shortTitle: "Export",
        longTitle: "Open Export Dropdown",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              toolbarDropdown: "export"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? defaultActionDisabledMessage : "There are no dataframes to export. Import data.";
        },
        searchTerms: ["export", "download", "excel", "csv"],
        tooltip: "Export dataframes as a .csv or .xlsx file."
      },
      ["fill na" /* Fill_Na */]: {
        type: "fill na" /* Fill_Na */,
        shortTitle: "Fill NaN",
        longTitle: "Fill NaN Values",
        actionFunction: () => {
          setEditorState(void 0);
          const selectedColumnIDs = getSelectedColumnIDsWithEntireSelectedColumn(gridState.selections, sheetData);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: {
                type: "fill_na" /* FILL_NA */,
                startingColumnIDs: selectedColumnIDs
              },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? defaultActionDisabledMessage : "There is no dataframe to fill nan values within.";
        },
        searchTerms: ["fill nan", "nan", "find", "replace", "null", "undefined", "fill null", "fill undefined", "empty", "none", "blank"],
        tooltip: "Fill all NaN values within a dataframe or list of columns."
      },
      ["filter" /* Filter */]: {
        type: "filter" /* Filter */,
        shortTitle: "Filter",
        longTitle: "Filter column",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ },
              selectedColumnControlPanelTab: "filter_sort" /* FilterSort */,
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray2) ? defaultActionDisabledMessage : "There are no columns to filter in the selected sheet. Add data to the sheet.";
        },
        searchTerms: ["filter", "remove", "delete"],
        tooltip: "Filter this dataframe based on the data in a column."
      },
      ["format number columns" /* Format_Number_Columns */]: {
        type: "format number columns" /* Format_Number_Columns */,
        shortTitle: "Number",
        longTitle: "Format number columns",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              toolbarDropdown: "format"
            });
          });
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray2)) {
            return "There are no columns to format. Import data.";
          }
          return getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData).length > 0 ? defaultActionDisabledMessage : FORMAT_DISABLED_MESSAGE;
        },
        searchTerms: ["format", "decimals", "percent", "%", "scientific", "Mill", "Bill", "round"],
        tooltip: "Format all of the selected columns as percents, choose the number of decimals, etc. This only changes the display of the data, and does not effect the underlying dataframe."
      },
      ["fullscreen" /* Fullscreen */]: {
        type: "fullscreen" /* Fullscreen */,
        shortTitle: "Fullscreen",
        longTitle: "Toggle fullscreen",
        actionFunction: () => {
          const isNotFullscreen = fscreen_esm_default.fullscreenElement === void 0 || fscreen_esm_default.fullscreenElement === null;
          if (isNotFullscreen && mitoContainerRef.current) {
            fscreen_esm_default.requestFullscreen(mitoContainerRef.current);
          } else {
            fscreen_esm_default.exitFullscreen();
          }
          void mitoAPI.log(
            "button_toggle_fullscreen",
            {
              fullscreen: !!fscreen_esm_default.fullscreenElement
            }
          );
        },
        isDisabled: () => {
          return void 0;
        },
        searchTerms: ["fullscreen", "zoom"],
        tooltip: "Enter fullscreen mode to see more of your data."
      },
      ["graph" /* Graph */]: {
        type: "graph" /* Graph */,
        shortTitle: "Graph",
        longTitle: "Create new graph",
        actionFunction: async () => {
          setEditorState(void 0);
          if (sheetDataArray2.length === 0) {
            setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: {
                  type: "import_first" /* IMPORT_FIRST */,
                  message: "Before graphing data, you need to import some!"
                }
              });
            });
            return;
          }
          const newGraphID = getRandomId();
          const graphParams = getDefaultGraphParams(sheetDataArray2, sheetIndex);
          await mitoAPI.editGraph(
            newGraphID,
            graphParams,
            "100%",
            "100%",
            void 0
          );
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? defaultActionDisabledMessage : "There are no dataframes to graph. Import data.";
        },
        searchTerms: ["graph", "chart", "visualize", "bar chart", "box plot", "scatter plot", "histogram"],
        tooltip: "Create an interactive graph. Pick from bar charts, histograms, scatter plots, etc."
      },
      ["help" /* Help */]: {
        type: "help" /* Help */,
        shortTitle: "Help",
        longTitle: "Help",
        actionFunction: () => {
          setEditorState(void 0);
          if (userProfile2.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL === DEFAULT_SUPPORT_EMAIL) {
            window.open(DISCORD_INVITE_LINK, "_blank");
          } else {
            window.open(`mailto:${userProfile2.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL}?subject=Mito support request`);
          }
        },
        isDisabled: () => {
          return void 0;
        },
        searchTerms: ["help", "contact", "support", "slack", "discord"],
        tooltip: "Join our Discord for more help."
      },
      ["import dropdown" /* Import_Dropdown */]: {
        type: "import dropdown" /* Import_Dropdown */,
        shortTitle: "Import",
        longTitle: "Open import dropdown",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              toolbarDropdown: "import"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["import", "upload", "new", "excel", "csv", "add"],
        tooltip: "Import any .csv or well-formatted .xlsx file as a new sheet."
      },
      ["import files" /* Import_Files */]: {
        type: "import files" /* Import_Files */,
        shortTitle: "Import",
        longTitle: "Import files",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "import files" /* IMPORT_FILES */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["import", "upload", "new", "excel", "csv", "add"],
        tooltip: "Import any .csv or well-formatted .xlsx file as a new sheet."
      },
      ["merge" /* Merge */]: {
        type: "merge" /* Merge */,
        shortTitle: "Merge",
        longTitle: "Merge dataframes",
        actionFunction: async () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "merge" /* MERGE */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return sheetDataArray2.length >= 2 ? defaultActionDisabledMessage : "You need to import at least two dataframes before you can merge them.";
        },
        searchTerms: ["merge", "join", "vlookup", "lookup", "anti", "diff", "difference", "unique"],
        tooltip: "Merge two dataframes together using a lookup, left, right, inner, or outer join. Or find the differences between two dataframes."
      },
      ["concat_dataframes" /* Concat_Dataframes */]: {
        type: "concat_dataframes" /* Concat_Dataframes */,
        shortTitle: "Concat",
        longTitle: "Concatenate dataframes",
        actionFunction: async () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "concat" /* CONCAT */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return sheetDataArray2.length >= 2 ? defaultActionDisabledMessage : "You need to import at least two dataframes before you can concatenate them.";
        },
        searchTerms: ["stack", "merge", "join", "concat", "concatenate", "append"],
        tooltip: "Concatenate two or more dataframes by stacking them vertically on top of eachother."
      },
      ["pivot" /* Pivot */]: {
        type: "pivot" /* Pivot */,
        shortTitle: "Pivot",
        longTitle: "Pivot table",
        actionFunction: async () => {
          setEditorState(void 0);
          if (dfSources[sheetIndex] === "pivoted" /* Pivoted */) {
            const existingPivotParams = await mitoAPI.getPivotParams(sheetIndex);
            if (existingPivotParams !== void 0) {
              setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenModal: { type: "None" /* None */ },
                  currOpenTaskpane: {
                    type: "pivot" /* PIVOT */,
                    sourceSheetIndex: existingPivotParams.sheet_index,
                    destinationSheetIndex: sheetIndex,
                    existingPivotParams
                  },
                  selectedTabType: "data"
                });
              });
              return;
            }
          }
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: {
                type: "pivot" /* PIVOT */,
                sourceSheetIndex: sheetIndex,
                destinationSheetIndex: void 0,
                existingPivotParams: void 0
              },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? defaultActionDisabledMessage : "There are no sheets to pivot. Import data.";
        },
        searchTerms: ["pivot", "group", "group by", "summarize", "aggregate"],
        tooltip: "Create a Pivot Table to summarise data by breaking the data into groups and calculating statistics about each group."
      },
      ["precision decrease" /* Precision_Decrease */]: {
        type: "precision decrease" /* Precision_Decrease */,
        shortTitle: "Less",
        longTitle: "Decrease decimal places displayed",
        actionFunction: async () => {
          const selectedNumberSeriesColumnIDs = getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData);
          const newDfFormat = window.structuredClone(dfFormat);
          selectedNumberSeriesColumnIDs.forEach((columnID2) => {
            const columnDtype = sheetData.columnDtypeMap[columnID2];
            const newColumnFormat = decreasePrecision(__spreadValues({}, newDfFormat.columns[columnID2]), columnDtype);
            newDfFormat.columns[columnID2] = newColumnFormat;
          });
          void mitoAPI.editSetDataframeFormat(sheetIndex, newDfFormat);
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray2)) {
            return "There are no columns to format. Import data.";
          }
          return getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData).length > 0 ? defaultActionDisabledMessage : FORMAT_DISABLED_MESSAGE;
        },
        searchTerms: ["format", "round", "decimal", "decimal places", "fraction"],
        tooltip: "Decrease the number of decimal places that are displayed in the selected number columns."
      },
      ["precision increase" /* Precision_Increase */]: {
        type: "precision increase" /* Precision_Increase */,
        shortTitle: "More",
        longTitle: "Increase decimal places displayed",
        actionFunction: async () => {
          const selectedNumberSeriesColumnIDs = getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData);
          const newDfFormat = window.structuredClone(dfFormat);
          selectedNumberSeriesColumnIDs.forEach((columnID2) => {
            const columnDtype = sheetData.columnDtypeMap[columnID2];
            const newColumnFormat = increasePrecision(__spreadValues({}, newDfFormat.columns[columnID2]), columnDtype);
            newDfFormat.columns[columnID2] = newColumnFormat;
          });
          void mitoAPI.editSetDataframeFormat(sheetIndex, newDfFormat);
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray2)) {
            return "There are no columns to format. Import data.";
          }
          return getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData).length > 0 ? defaultActionDisabledMessage : FORMAT_DISABLED_MESSAGE;
        },
        searchTerms: ["format", "round", "decimal", "decimal places", "fraction"],
        tooltip: "Increase the number of decimal places that are displayed in the selected number columns."
      },
      ["promote row to header" /* Promote_Row_To_Header */]: {
        type: "promote row to header" /* Promote_Row_To_Header */,
        shortTitle: "Promote to Header",
        longTitle: "Promote Row to header",
        actionFunction: async () => {
          const rowsToPromote = getSelectedRowLabelsWithEntireSelectedRow(gridState.selections, sheetData);
          if (rowsToPromote.length > 0) {
            void mitoAPI.editPromoteRowToHeader(sheetIndex, rowsToPromote[0]);
          }
        },
        isDisabled: () => {
          const rowsToDelete = getSelectedRowLabelsWithEntireSelectedRow(gridState.selections, sheetData);
          if (rowsToDelete.length > 0) {
            return defaultActionDisabledMessage;
          }
          return "There is no selected row to promote to header.";
        },
        searchTerms: ["make header", "row to header", "rename headers", "column headers", "promote row"],
        tooltip: "Promote the selected row to be the header of the dataframe, and delete it."
      },
      ["redo" /* Redo */]: {
        type: "redo" /* Redo */,
        shortTitle: "Redo",
        longTitle: "Redo",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups(ALLOW_UNDO_REDO_EDITING_TASKPANES);
          void mitoAPI.updateRedo();
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["redo", "undo"],
        tooltip: "Reapplies the last step that you undid, as long as you haven't made any edits since the undo.",
        displayKeyboardShortcuts: {
          mac: "Cmd+Y",
          windows: "Ctrl+Y"
        }
      },
      ["rename column" /* Rename_Column */]: {
        type: "rename column" /* Rename_Column */,
        shortTitle: "Rename Column",
        longTitle: "Rename column",
        actionFunction: () => {
          const columnHeader = getCellDataFromCellIndexes(sheetData, -1, startingColumnIndex).columnHeader;
          const columnHeaderSafe = columnHeader !== void 0 ? columnHeader : "";
          const finalColumnHeader = getColumnHeaderParts(columnHeaderSafe).finalColumnHeader;
          setEditorState({
            rowIndex: -1,
            columnIndex: startingColumnIndex,
            formula: getDisplayColumnHeader(finalColumnHeader),
            editorLocation: "cell",
            editingMode: "specific_index_labels"
          });
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray2) ? defaultActionDisabledMessage : "There are no columns in the dataframe to rename. Add data to the dataframe.";
        },
        searchTerms: ["rename", "name", "header"],
        tooltip: "Rename the selected column."
      },
      ["rename dataframe" /* Rename_Dataframe */]: {
        type: "rename dataframe" /* Rename_Dataframe */,
        shortTitle: "Rename dataframe",
        longTitle: "Rename dataframe",
        actionFunction: () => {
          const selectedSheetTab = document.querySelector(".tab-selected");
          if (selectedSheetTab) {
            const event = new MouseEvent("dblclick", {
              "view": window,
              "bubbles": true,
              "cancelable": true
            });
            selectedSheetTab.dispatchEvent(event);
          }
        },
        isDisabled: () => {
          return getDataframeIsSelected(uiState, sheetDataArray2) ? defaultActionDisabledMessage : "There is no selected dataframe to rename.";
        },
        searchTerms: ["rename", "name"],
        tooltip: "Rename the selected sheet."
      },
      ["rename graph" /* Rename_Graph */]: {
        type: "rename graph" /* Rename_Graph */,
        shortTitle: "Rename Graph",
        longTitle: "Rename graph",
        actionFunction: () => {
          const selectedSheetTab = document.querySelector(".tab-selected");
          if (selectedSheetTab) {
            const event = new MouseEvent("dblclick", {
              "view": window,
              "bubbles": true,
              "cancelable": true
            });
            selectedSheetTab.dispatchEvent(event);
          }
        },
        isDisabled: () => {
          return getGraphIsSelected(uiState) ? defaultActionDisabledMessage : "There is not selected graph to rename.";
        },
        searchTerms: ["rename", "name", "graph"],
        tooltip: "Rename the selected graph."
      },
      ["see all functionality" /* See_All_Functionality */]: {
        type: "see all functionality" /* See_All_Functionality */,
        shortTitle: "See All Functionality",
        longTitle: "See all functionality",
        actionFunction: () => {
          setEditorState(void 0);
          void mitoAPI.log("clicked_documentation");
          window.open("https://docs.trymito.io/how-to/importing-data-to-mito", "_blank");
        },
        isDisabled: () => {
          return void 0;
        },
        searchTerms: ["docs", "documentation", "help", "support"],
        tooltip: "Documentation, tutorials, and how-tos on all functionality in Mito."
      },
      ["set cell value" /* Set_Cell_Value */]: {
        type: "set cell value" /* Set_Cell_Value */,
        shortTitle: "Set Cell Value",
        longTitle: "Set cell value",
        actionFunction: async () => {
          if (startingColumnID === void 0) {
            return;
          }
          closeOpenEditingPopups();
          setEditorState({
            rowIndex: startingRowIndex,
            columnIndex: startingColumnIndex,
            formula: startingColumnFormula,
            arrowKeysScrollInFormula: true,
            editorLocation: "cell",
            editingMode: "specific_index_labels"
          });
        },
        isDisabled: () => {
          if (!doesColumnExist(startingColumnID, sheetIndex, sheetDataArray2) || !doesSheetContainData(sheetIndex, sheetDataArray2)) {
            return "There are no cells in the dataframe to set the value of. Add data to the sheet.";
          }
          if (startingRowIndex === -1) {
            return "An entire column is selected. Select a single cell to edit.";
          }
          return defaultActionDisabledMessage;
        },
        searchTerms: ["formula", "function", "edit", "set", "set formula", "set column formula"],
        tooltip: "Update the value of a specific cell in a data column."
      },
      ["set column formula" /* Set_Column_Formula */]: {
        type: "set column formula" /* Set_Column_Formula */,
        shortTitle: "Set Column Formula",
        longTitle: "Set column formula",
        actionFunction: async () => {
          closeOpenEditingPopups();
          setEditorState({
            rowIndex: startingRowIndex !== -1 ? startingRowIndex : 0,
            columnIndex: startingColumnIndex,
            formula: startingColumnFormula,
            arrowKeysScrollInFormula,
            editorLocation: "cell",
            editingMode: "entire_column"
          });
        },
        isDisabled: () => {
          if (!doesColumnExist(startingColumnID, sheetIndex, sheetDataArray2) || !doesSheetContainData(sheetIndex, sheetDataArray2)) {
            return "There are no cells in the dataframe to set the formula of. Add data to the sheet.";
          }
          return defaultActionDisabledMessage;
        },
        searchTerms: ["formula", "function", "edit", "set", "set formula", "set column formula"],
        tooltip: "Use one of Mito's spreadsheet formulas or basic math operators to set the column's values."
      },
      ["sort" /* Sort */]: {
        type: "sort" /* Sort */,
        shortTitle: "Sort",
        longTitle: "Sort column",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ },
              selectedColumnControlPanelTab: "filter_sort" /* FilterSort */,
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray2) ? defaultActionDisabledMessage : "There are no columns to sort in the selected sheet. Add data to the sheet.";
        },
        searchTerms: ["sort", "ascending", "descending", "arrange"],
        tooltip: "Sort a column in ascending or descending order."
      },
      ["split text to column" /* Split_Text_To_Column */]: {
        type: "split text to column" /* Split_Text_To_Column */,
        shortTitle: "Split",
        longTitle: "Split text to columns",
        actionFunction: () => {
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "split_text_to_columns" /* SPLIT_TEXT_TO_COLUMNS */, startingColumnID }
            });
          });
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray2) ? defaultActionDisabledMessage : "There are no columns in the selected sheet. Add data to the sheet.";
        },
        searchTerms: ["split", "extract", "parse", "column", "splice", "text", "delimiter", "comma", "space", "tab", "dash"],
        tooltip: "Split a column on a delimiter to break it into multiple columns."
      },
      ["steps" /* Steps */]: {
        type: "steps" /* Steps */,
        shortTitle: "Steps",
        longTitle: "Step history",
        actionFunction: () => {
          void mitoAPI.log("click_open_steps");
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "steps" /* STEPS */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["steps", "history"],
        tooltip: "View a list of all the edits you've made to your data."
      },
      ["undo" /* Undo */]: {
        type: "undo" /* Undo */,
        shortTitle: "Undo",
        longTitle: "Undo",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups(ALLOW_UNDO_REDO_EDITING_TASKPANES);
          void mitoAPI.updateUndo();
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["undo", "go back", "redo"],
        tooltip: "Undo the most recent edit.",
        displayKeyboardShortcuts: {
          mac: "Cmd+Z",
          windows: "Ctrl+Z"
        }
      },
      ["unique values" /* Unique_Values */]: {
        type: "unique values" /* Unique_Values */,
        shortTitle: "Unique Vals",
        longTitle: "View unique values",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ },
              selectedColumnControlPanelTab: "unique_values" /* UniqueValues */,
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray2) ? defaultActionDisabledMessage : "There are no columns in the selected sheet. Add data to the sheet.";
        },
        searchTerms: ["unique values", "values", "toggle", "filter"],
        tooltip: "See a list of unique values in the column, and toggle to filter them."
      },
      ["upgrade to pro" /* Upgrade_To_Pro */]: {
        type: "upgrade to pro" /* Upgrade_To_Pro */,
        shortTitle: "Upgrade to Pro",
        longTitle: "Upgrade to Mito Pro",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "upgrade_to_pro" /* UPGRADE_TO_PRO */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["pro", "upgrade", "mito pro", "open source"],
        tooltip: "Upgrade to a Mito Pro account and get access to all of Mito Pro's functionality."
      },
      ["transpose" /* Transpose */]: {
        type: "transpose" /* Transpose */,
        shortTitle: "Transpose Dataframe",
        longTitle: "Transpose dataframe",
        actionFunction: () => {
          void mitoAPI.editTranspose(sheetIndex);
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? defaultActionDisabledMessage : "Import data before transposing it";
        },
        searchTerms: ["transpose", "diagonal", "rows and columns", "flip", "rotate"],
        tooltip: "Switches rows and columns in a dataframe"
      },
      ["melt" /* Melt */]: {
        type: "melt" /* Melt */,
        shortTitle: "Unpivot",
        longTitle: "Unpivot dataframe",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "melt" /* MELT */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? defaultActionDisabledMessage : "Import data before trying to unpivot it";
        },
        searchTerms: ["Melt", "Unpivot"],
        tooltip: "Unpivot a DataFrame from wide to long format."
      },
      ["one_hot_encoding" /* One_Hot_Encoding */]: {
        type: "one_hot_encoding" /* One_Hot_Encoding */,
        shortTitle: "One-hot Encoding",
        longTitle: "One-hot Encoding",
        actionFunction: () => {
          if (columnID) {
            closeOpenEditingPopups();
            void mitoAPI.editOneHotEncoding(sheetIndex, columnID);
          }
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray2) ? defaultActionDisabledMessage : "There are no columns in the selected sheet. Add data to the sheet.";
        },
        searchTerms: ["one-hot encoding", "dummies", "get dummies", "categorical"],
        tooltip: "One Hot Encoding"
      },
      ["set_dataframe_format" /* Set_Dataframe_Format */]: {
        type: "set_dataframe_format" /* Set_Dataframe_Format */,
        shortTitle: "Set Dataframe Colors",
        longTitle: "Set dataframe colors",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "set_dataframe_format" /* SET_DATAFRAME_FORMAT */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? defaultActionDisabledMessage : "There are no data to format. Import data before formatting.";
        },
        searchTerms: ["Set dataframe format", "dataframe", "format", "color", "color palette", "border", "highlight"],
        tooltip: "Change the styling of the header, rows, and border of the dataframe."
      },
      ["ConditionalFormatting" /* Conditional_Formatting */]: {
        type: "ConditionalFormatting" /* Conditional_Formatting */,
        shortTitle: "Conditional Formatting",
        longTitle: "Conditional formatting",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "ConditionalFormatting" /* CONDITIONALFORMATTING */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? defaultActionDisabledMessage : "There is no data to format. Import data.";
        },
        searchTerms: ["formatting", "conditional", "color", "background", "highlight"],
        tooltip: "Set the background color and text color of the cell based on a condition."
      },
      ["Dataframe_Import" /* Dataframe_Import */]: {
        type: "Dataframe_Import" /* Dataframe_Import */,
        shortTitle: "Import Dataframes",
        longTitle: "Import dataframes",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "DataframeImport" /* DATAFRAMEIMPORT */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["Dataframe Import"],
        tooltip: "Dataframe Import"
      },
      ["updateImports" /* UPDATEIMPORTS */]: {
        type: "updateImports" /* UPDATEIMPORTS */,
        shortTitle: "Change imports",
        longTitle: "Change imported data",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "UpdateImports" /* UPDATEIMPORTS */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return commCreationStatus !== "finished" ? defaultActionDisabledMessage : void 0;
        },
        searchTerms: ["update", "imports", "replay", "refresh", "change"],
        tooltip: "Change imported data to rerun the same edits on new data."
      },
      ["CodeSnippets" /* CODESNIPPETS */]: {
        type: "CodeSnippets" /* CODESNIPPETS */,
        shortTitle: "Code Snippets",
        longTitle: "Code Snippets",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "CodeSnippets" /* CODESNIPPETS */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return void 0;
        },
        searchTerms: ["CodeSnippets"],
        tooltip: "CodeSnippets"
      },
      ["Export_To_File" /* EXPORT_TO_FILE */]: {
        type: "Export_To_File" /* EXPORT_TO_FILE */,
        shortTitle: "Generate Export Code",
        longTitle: "Generate Export Code",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "Export To File" /* EXPORT_TO_FILE */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? void 0 : "Import data before exporting it";
        },
        searchTerms: ["export", "download", "file"],
        tooltip: "Generate code that exports dataframes to files."
      },
      ["reset and keep index" /* RESET_AND_KEEP_INDEX */]: {
        type: "reset and keep index" /* RESET_AND_KEEP_INDEX */,
        shortTitle: "Reset and Keep Index",
        longTitle: "Reset and Keep Index",
        actionFunction: () => {
          void mitoAPI.editResetIndex(sheetIndex, false);
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? void 0 : "Import data before resetting an index.";
        },
        searchTerms: ["reset", "index"],
        tooltip: "Resets a dataframe's index to 0,1,2,3... Keeps the current index as a column in the dataframe."
      },
      ["reset and drop index" /* RESET_AND_DROP_INDEX */]: {
        type: "reset and drop index" /* RESET_AND_DROP_INDEX */,
        shortTitle: "Reset and Drop Index",
        longTitle: "Reset and Drop Index",
        actionFunction: () => {
          void mitoAPI.editResetIndex(sheetIndex, true);
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray2) ? void 0 : "Import data before resetting an index.";
        },
        searchTerms: ["reset", "index"],
        tooltip: "Resets a dataframe's index to 0,1,2,3... Removes current index entirely."
      },
      ["SnowflakeImport" /* SNOWFLAKEIMPORT */]: {
        type: "SnowflakeImport" /* SNOWFLAKEIMPORT */,
        shortTitle: "Snowflake Import",
        longTitle: "Snowflake Import",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "SnowflakeImport" /* SNOWFLAKEIMPORT */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          if (!userProfile2.isPro) {
            return "Only available in Mito Pro and Mito Enterprise";
          } else {
            return void 0;
          }
        },
        searchTerms: ["SQL", "database", "snowflake", "import"],
        tooltip: "Import dataframe from a Snowflake data warehouse",
        proAction: true
      },
      ["abs" /* ABS */]: getSpreadsheetFormulaAction(
        "abs" /* ABS */,
        getFuncDocObjFromFuncName("abs"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["and" /* AND */]: getSpreadsheetFormulaAction(
        "and" /* AND */,
        getFuncDocObjFromFuncName("and"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["avg" /* AVG */]: getSpreadsheetFormulaAction(
        "avg" /* AVG */,
        getFuncDocObjFromFuncName("avg"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["bool" /* BOOL */]: getSpreadsheetFormulaAction(
        "bool" /* BOOL */,
        getFuncDocObjFromFuncName("bool"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["clean" /* CLEAN */]: getSpreadsheetFormulaAction(
        "clean" /* CLEAN */,
        getFuncDocObjFromFuncName("clean"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["concat" /* CONCAT */]: getSpreadsheetFormulaAction(
        "concat" /* CONCAT */,
        getFuncDocObjFromFuncName("concat"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["corr" /* CORR */]: getSpreadsheetFormulaAction(
        "corr" /* CORR */,
        getFuncDocObjFromFuncName("corr"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["datevalue" /* DATEVALUE */]: getSpreadsheetFormulaAction(
        "datevalue" /* DATEVALUE */,
        getFuncDocObjFromFuncName("datevalue"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["day" /* DAY */]: getSpreadsheetFormulaAction(
        "day" /* DAY */,
        getFuncDocObjFromFuncName("day"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["endofbusinessmonth" /* ENDOFBUSINESSMONTH */]: getSpreadsheetFormulaAction(
        "endofbusinessmonth" /* ENDOFBUSINESSMONTH */,
        getFuncDocObjFromFuncName("endofbusinessmonth"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["endofmonth" /* ENDOFMONTH */]: getSpreadsheetFormulaAction(
        "endofmonth" /* ENDOFMONTH */,
        getFuncDocObjFromFuncName("endofmonth"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["exp" /* EXP */]: getSpreadsheetFormulaAction(
        "exp" /* EXP */,
        getFuncDocObjFromFuncName("exp"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["fillnan" /* FILLNAN */]: getSpreadsheetFormulaAction(
        "fillnan" /* FILLNAN */,
        getFuncDocObjFromFuncName("fillnan"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["find" /* FIND */]: getSpreadsheetFormulaAction(
        "find" /* FIND */,
        getFuncDocObjFromFuncName("find"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["float" /* FLOAT */]: getSpreadsheetFormulaAction(
        "float" /* FLOAT */,
        getFuncDocObjFromFuncName("float"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["hour" /* HOUR */]: getSpreadsheetFormulaAction(
        "hour" /* HOUR */,
        getFuncDocObjFromFuncName("hour"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["if" /* IF */]: getSpreadsheetFormulaAction(
        "if" /* IF */,
        getFuncDocObjFromFuncName("if"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["int" /* INT */]: getSpreadsheetFormulaAction(
        "int" /* INT */,
        getFuncDocObjFromFuncName("int"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["kurt" /* KURT */]: getSpreadsheetFormulaAction(
        "kurt" /* KURT */,
        getFuncDocObjFromFuncName("kurt"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["left" /* LEFT */]: getSpreadsheetFormulaAction(
        "left" /* LEFT */,
        getFuncDocObjFromFuncName("left"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["len" /* LEN */]: getSpreadsheetFormulaAction(
        "len" /* LEN */,
        getFuncDocObjFromFuncName("len"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["lower" /* LOWER */]: getSpreadsheetFormulaAction(
        "lower" /* LOWER */,
        getFuncDocObjFromFuncName("lower"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["max" /* MAX */]: getSpreadsheetFormulaAction(
        "max" /* MAX */,
        getFuncDocObjFromFuncName("max"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["mid" /* MID */]: getSpreadsheetFormulaAction(
        "mid" /* MID */,
        getFuncDocObjFromFuncName("mid"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["min" /* MIN */]: getSpreadsheetFormulaAction(
        "min" /* MIN */,
        getFuncDocObjFromFuncName("min"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["minute" /* MINUTE */]: getSpreadsheetFormulaAction(
        "minute" /* MINUTE */,
        getFuncDocObjFromFuncName("minute"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["month" /* MONTH */]: getSpreadsheetFormulaAction(
        "month" /* MONTH */,
        getFuncDocObjFromFuncName("month"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["multiply" /* MULTIPLY */]: getSpreadsheetFormulaAction(
        "multiply" /* MULTIPLY */,
        getFuncDocObjFromFuncName("multiply"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["or" /* OR */]: getSpreadsheetFormulaAction(
        "or" /* OR */,
        getFuncDocObjFromFuncName("or"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["power" /* POWER */]: getSpreadsheetFormulaAction(
        "power" /* POWER */,
        getFuncDocObjFromFuncName("power"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["proper" /* PROPER */]: getSpreadsheetFormulaAction(
        "proper" /* PROPER */,
        getFuncDocObjFromFuncName("proper"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["quarter" /* QUARTER */]: getSpreadsheetFormulaAction(
        "quarter" /* QUARTER */,
        getFuncDocObjFromFuncName("quarter"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["right" /* RIGHT */]: getSpreadsheetFormulaAction(
        "right" /* RIGHT */,
        getFuncDocObjFromFuncName("right"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["round" /* ROUND */]: getSpreadsheetFormulaAction(
        "round" /* ROUND */,
        getFuncDocObjFromFuncName("round"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["second" /* SECOND */]: getSpreadsheetFormulaAction(
        "second" /* SECOND */,
        getFuncDocObjFromFuncName("second"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["skew" /* SKEW */]: getSpreadsheetFormulaAction(
        "skew" /* SKEW */,
        getFuncDocObjFromFuncName("skew"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["startofbusinessmonth" /* STARTOFBUSINESSMONTH */]: getSpreadsheetFormulaAction(
        "startofbusinessmonth" /* STARTOFBUSINESSMONTH */,
        getFuncDocObjFromFuncName("startofbusinessmonth"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["startofmonth" /* STARTOFMONTH */]: getSpreadsheetFormulaAction(
        "startofmonth" /* STARTOFMONTH */,
        getFuncDocObjFromFuncName("startofmonth"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["striptimetominutes" /* STRIPTIMETOMINUTES */]: getSpreadsheetFormulaAction(
        "striptimetominutes" /* STRIPTIMETOMINUTES */,
        getFuncDocObjFromFuncName("striptimetominutes"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["striptimetohours" /* STRIPTIMETOHOURS */]: getSpreadsheetFormulaAction(
        "striptimetohours" /* STRIPTIMETOHOURS */,
        getFuncDocObjFromFuncName("striptimetohours"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["striptimetodays" /* STRIPTIMETODAYS */]: getSpreadsheetFormulaAction(
        "striptimetodays" /* STRIPTIMETODAYS */,
        getFuncDocObjFromFuncName("striptimetodays"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["striptimetomonths" /* STRIPTIMETOMONTHS */]: getSpreadsheetFormulaAction(
        "striptimetomonths" /* STRIPTIMETOMONTHS */,
        getFuncDocObjFromFuncName("striptimetomonths"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["striptimetoyears" /* STRIPTIMETOYEARS */]: getSpreadsheetFormulaAction(
        "striptimetoyears" /* STRIPTIMETOYEARS */,
        getFuncDocObjFromFuncName("striptimetoyears"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["substitute" /* SUBSTITUTE */]: getSpreadsheetFormulaAction(
        "substitute" /* SUBSTITUTE */,
        getFuncDocObjFromFuncName("substitute"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["sum" /* SUM */]: getSpreadsheetFormulaAction(
        "sum" /* SUM */,
        getFuncDocObjFromFuncName("sum"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["text" /* TEXT */]: getSpreadsheetFormulaAction(
        "text" /* TEXT */,
        getFuncDocObjFromFuncName("text"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["trim" /* TRIM */]: getSpreadsheetFormulaAction(
        "trim" /* TRIM */,
        getFuncDocObjFromFuncName("trim"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["type" /* TYPE */]: getSpreadsheetFormulaAction(
        "type" /* TYPE */,
        getFuncDocObjFromFuncName("type"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["upper" /* UPPER */]: getSpreadsheetFormulaAction(
        "upper" /* UPPER */,
        getFuncDocObjFromFuncName("upper"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["value" /* VALUE */]: getSpreadsheetFormulaAction(
        "value" /* VALUE */,
        getFuncDocObjFromFuncName("value"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["var" /* VAR */]: getSpreadsheetFormulaAction(
        "var" /* VAR */,
        getFuncDocObjFromFuncName("var"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["week" /* WEEK */]: getSpreadsheetFormulaAction(
        "week" /* WEEK */,
        getFuncDocObjFromFuncName("week"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["weekday" /* WEEEKDAY */]: getSpreadsheetFormulaAction(
        "weekday" /* WEEEKDAY */,
        getFuncDocObjFromFuncName("weekday"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      ),
      ["year" /* YEAR */]: getSpreadsheetFormulaAction(
        "year" /* YEAR */,
        getFuncDocObjFromFuncName("year"),
        gridState,
        sheetDataArray2,
        sheetIndex,
        setEditorState
      )
    };
    return actions;
  };
  var getSpreadsheetFormulaAction = (type, spreadsheetAction, gridState, sheetDataArray2, sheetIndex, setEditorState) => {
    const action = {
      type,
      shortTitle: (spreadsheetAction == null ? void 0 : spreadsheetAction.function) || "",
      longTitle: (spreadsheetAction == null ? void 0 : spreadsheetAction.function) || "",
      actionFunction: () => {
        const columnIndex = gridState.selections[gridState.selections.length - 1].startingColumnIndex;
        let rowIndex = gridState.selections[gridState.selections.length - 1].startingRowIndex;
        if (rowIndex === -1) {
          rowIndex = 0;
        }
        setEditorState({
          rowIndex,
          columnIndex,
          formula: "=" + (spreadsheetAction == null ? void 0 : spreadsheetAction.function) + "(",
          arrowKeysScrollInFormula: false,
          editorLocation: "cell",
          editingMode: "entire_column"
        });
      },
      isDisabled: () => {
        const startingRowIndex = gridState.selections[gridState.selections.length - 1].startingRowIndex;
        const startingColumnIndex = gridState.selections[gridState.selections.length - 1].startingColumnIndex;
        const startingColumnID = getCellDataFromCellIndexes(sheetDataArray2[sheetIndex], startingRowIndex, startingColumnIndex).columnID;
        if (!doesColumnExist(startingColumnID, sheetIndex, sheetDataArray2) || !doesSheetContainData(sheetIndex, sheetDataArray2)) {
          return "There are no cells in the dataframe to set the formula of. Add data to the sheet.";
        }
        return void 0;
      },
      searchTerms: (spreadsheetAction == null ? void 0 : spreadsheetAction.search_terms) || [],
      tooltip: (spreadsheetAction == null ? void 0 : spreadsheetAction.description) ? spreadsheetAction.description : "",
      category: "spreadsheet formula"
    };
    return action;
  };
  var getSortedActions = (actions) => {
    const actionsArray = Object.values(actions);
    actionsArray.sort(function(actionOne, actionTwo) {
      const titleOne = actionOne.longTitle ? actionOne.longTitle : actionOne.shortTitle;
      const titleTwo = actionTwo.longTitle ? actionTwo.longTitle : actionTwo.shortTitle;
      if (actionOne.category == "spreadsheet formula" && actionTwo.category != "spreadsheet formula") {
        return 1;
      }
      if (actionOne.category != "spreadsheet formula" && actionTwo.category == "spreadsheet formula") {
        return -1;
      }
      if (titleOne < titleTwo) {
        return -1;
      }
      if (titleOne > titleTwo) {
        return 1;
      }
      return 0;
    });
    const actionEnumsToPutAtBottom = ["see all functionality" /* See_All_Functionality */];
    actionEnumsToPutAtBottom.forEach((actionEnum) => {
      const actionIndex = actionsArray.findIndex((action) => action.type === actionEnum);
      if (actionIndex !== -1) {
        actionsArray.splice(actionIndex, 1);
      }
      actionsArray.push(actions[actionEnum]);
    });
    return actionsArray;
  };
  var getFuncDocObjFromFuncName = (func) => {
    return functionDocumentationObjects.find((fdo) => fdo.function.toLowerCase() === func.toLowerCase());
  };

  // src/utils/plotly.tsx
  var loadPlotlyWithScriptElement = () => {
    const script = document.createElement("script");
    script.async = true;
    script.src = "https://cdn.plot.ly/plotly-latest.min.js";
    document.head.appendChild(script);
  };
  var loadPlotlyWithRequireJS = () => {
    const requirejs = window.requirejs;
    if (requirejs) {
      requirejs(
        ["https://cdn.plot.ly/plotly-latest.min.js"],
        function(p) {
          window.Plotly = p;
        }
      );
    }
  };
  var loadPlotly = () => {
    if (!("Plotly" in window)) {
      const requirejs = window.requirejs;
      if (requirejs) {
        loadPlotlyWithRequireJS();
      } else {
        loadPlotlyWithScriptElement();
      }
    }
  };
  var plotly_default = loadPlotly;

  // src/components/CatchUpPopup.tsx
  var import_react85 = __toESM(require_react());

  // src/components/icons/CatchUpIcon.tsx
  var import_react84 = __toESM(require_react());
  var CatchUpIcon = (props) => {
    if (props.variant === "light") {
      return /* @__PURE__ */ import_react84.default.createElement("svg", { width: "16", height: "15", viewBox: "0 0 16 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react84.default.createElement("path", { d: "M1 14L7.5 7.96429L1 1V14Z", stroke: "white", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ import_react84.default.createElement("path", { d: "M8.42578 14L14.9258 7.96429L8.42578 1V14Z", stroke: "white", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }));
    } else {
      return /* @__PURE__ */ import_react84.default.createElement("svg", { width: "14", height: "13", viewBox: "0 0 14 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react84.default.createElement("path", { d: "M1 12.2L6.6 7L1 1V12.2Z", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ import_react84.default.createElement("path", { d: "M7.39844 12.2L12.9984 7L7.39844 1V12.2Z", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }));
    }
  };
  var CatchUpIcon_default = CatchUpIcon;

  // src/components/CatchUpPopup.tsx
  var FastForwardPopup = (props) => {
    return /* @__PURE__ */ import_react85.default.createElement(
      "div",
      {
        onClick: props.fastForward,
        className: "catch-up-popup-container"
      },
      /* @__PURE__ */ import_react85.default.createElement(Row_default, null, /* @__PURE__ */ import_react85.default.createElement(Col_default, null, /* @__PURE__ */ import_react85.default.createElement("p", { className: "text-overflow-wrap" }, "You are viewing a previous step, and cannot make any edits."))),
      /* @__PURE__ */ import_react85.default.createElement(Row_default, null, /* @__PURE__ */ import_react85.default.createElement(Col_default, null, /* @__PURE__ */ import_react85.default.createElement(CatchUpIcon_default, { variant: "light" })), /* @__PURE__ */ import_react85.default.createElement(Col_default, { offset: 1 }, /* @__PURE__ */ import_react85.default.createElement("p", null, /* @__PURE__ */ import_react85.default.createElement("span", { className: "text-underline" }, " Catch up"), " to start editing.")))
    );
  };
  var CatchUpPopup_default = FastForwardPopup;

  // src/components/elements/ErrorBoundary.tsx
  var import_react86 = __toESM(require_react());
  var ErrorBoundary = class extends import_react86.Component {
    constructor() {
      super(...arguments);
      this.state = {
        hasError: false
      };
    }
    static getDerivedStateFromError() {
      return { hasError: true };
    }
    componentDidCatch(error) {
      var _a;
      console.error("Sheet crashing error", error);
      console.error("userProfile", this.props.userProfile);
      console.error("analysisData", this.props.analyisData);
      console.error("sheetDataArray", this.props.sheetDataArray);
      void this.props.mitoAPI.log("frontend_render_failed", {
        "error_name": error.name,
        "error_message": error.message,
        "error_stack": (_a = error.stack) == null ? void 0 : _a.split("\n")
      });
    }
    render() {
      if (this.state.hasError) {
        return /* @__PURE__ */ import_react86.default.createElement("p", { className: "text-body-1 text-color-red p-10px" }, "Looks like Mito had an error! Sorry about that. Rerun the Jupyter Cell above, and join our ", /* @__PURE__ */ import_react86.default.createElement("a", { className: "text-body-1-link", href: DISCORD_INVITE_LINK, target: "_blank", rel: "noreferrer" }, "Discord"), " for support if this error occurs again.");
      }
      return this.props.children;
    }
  };
  var ErrorBoundary_default = ErrorBoundary;

  // src/components/footer/Footer.tsx
  var import_react94 = __toESM(require_react());

  // src/components/footer/SheetTab.tsx
  var import_react92 = __toESM(require_react());

  // src/components/icons/SelectedSheetTabDropdownIcon.tsx
  var import_react87 = __toESM(require_react());
  var SelectedSheetTabDropdownIcon = () => {
    return /* @__PURE__ */ import_react87.default.createElement("svg", { width: "8", height: "6", viewBox: "0 0 8 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react87.default.createElement("path", { d: "M1 1L4.00283 4L7 1", stroke: "#F2F2F2", strokeWidth: "2", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var SelectedSheetTabDropdownIcon_default = SelectedSheetTabDropdownIcon;

  // src/components/icons/UnselectedSheetTabDropdownIcon.tsx
  var import_react88 = __toESM(require_react());
  var UnselectedSheetTabDropdownIcon = () => {
    return /* @__PURE__ */ import_react88.default.createElement("svg", { width: "8", height: "6", viewBox: "0 0 8 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react88.default.createElement("path", { d: "M1 1L4.00283 4L7 1", stroke: "#343434", strokeWidth: "2", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var UnselectedSheetTabDropdownIcon_default = UnselectedSheetTabDropdownIcon;

  // src/components/icons/GraphIcon.tsx
  var import_react89 = __toESM(require_react());
  var GraphIcon = (props) => {
    if (props.variant === "light") {
      return /* @__PURE__ */ import_react89.default.createElement("svg", { width: "13", height: "15", viewBox: "0 0 13 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react89.default.createElement("path", { d: "M1 5.5874V14.3589", stroke: "white", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react89.default.createElement("path", { d: "M4.64453 9.67969V14.3588", stroke: "white", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react89.default.createElement("path", { d: "M8.28906 1V14.3588", stroke: "white", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react89.default.createElement("path", { d: "M11.9336 5.5874V14.3589", stroke: "white", strokeMiterlimit: "10", strokeLinecap: "round" }));
    } else {
      return /* @__PURE__ */ import_react89.default.createElement("svg", { width: "13", height: "15", viewBox: "0 0 13 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react89.default.createElement("path", { d: "M1 5.61938V14.3908", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react89.default.createElement("path", { d: "M4.64453 9.71167V14.3908", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react89.default.createElement("path", { d: "M8.28906 1.03198V14.3908", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react89.default.createElement("path", { d: "M11.9336 5.61938V14.3908", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }));
    }
  };
  var GraphIcon_default = GraphIcon;

  // src/components/footer/DataSheetTabActions.tsx
  var import_react90 = __toESM(require_react());
  var getGraphTabNamesAndIDsFromSheetIndex = (sheetIndex, graphDataDict) => {
    const filteredGraphDataJSON = Object.fromEntries(Object.entries(graphDataDict || {}).filter(([, graphData]) => {
      return graphData.graphParams.graphCreation.sheet_index === sheetIndex;
    }));
    return Object.entries(filteredGraphDataJSON).map(([graphID, graphData]) => {
      return { graphTabName: graphData.graphTabName, graphID };
    });
  };
  function SheetTabActions(props) {
    var _a;
    const imported = ((_a = props.sheetDataArray[props.sheetIndex]) == null ? void 0 : _a.dfSource) === "imported" /* Imported */;
    (0, import_react90.useEffect)(() => {
      if (props.display) {
        void props.mitoAPI.log(
          "clicked_data_sheet_tab_actions",
          {
            sheet_index: props.sheetIndex
          }
        );
      }
    }, [props.display]);
    const onDelete = async () => {
      const dependantGraphTabNamesAndIDs = getGraphTabNamesAndIDsFromSheetIndex(props.sheetIndex, props.graphDataDict);
      if (dependantGraphTabNamesAndIDs.length > 0) {
        props.setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenModal: {
              type: "DeleteGraphs" /* DeleteGraphs */,
              dependantGraphTabNamesAndIDs,
              sheetIndex: props.sheetIndex
            }
          });
        });
      } else {
        props.setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            selectedTabType: "data",
            selectedSheetIndex: prevUIState.selectedSheetIndex > 0 ? prevUIState.selectedSheetIndex - 1 : 0
          });
        });
        props.closeOpenEditingPopups();
        await props.mitoAPI.editDataframeDelete(props.sheetIndex);
      }
    };
    const onDuplicate = async () => {
      props.closeOpenEditingPopups();
      await props.mitoAPI.editDataframeDuplicate(props.sheetIndex);
    };
    const onRename = () => {
      props.setIsRename(true);
    };
    const graphData = async () => {
      const newGraphID = getRandomId();
      const graphParams = getDefaultGraphParams(props.sheetDataArray, props.sheetIndex);
      await props.mitoAPI.editGraph(
        newGraphID,
        graphParams,
        "100%",
        "100%",
        void 0
      );
    };
    const openDownloadTaskpane = async () => {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: { type: "download" /* DOWNLOAD */ },
          currOpenModal: { type: "None" /* None */ }
        });
      });
    };
    const dropdownItems = [
      /* @__PURE__ */ import_react90.default.createElement(
        DropdownItem_default,
        {
          key: "Create graph",
          title: "Create graph",
          onClick: (e) => {
            e == null ? void 0 : e.stopPropagation();
            void graphData();
          }
        }
      ),
      /* @__PURE__ */ import_react90.default.createElement(
        DropdownItem_default,
        {
          key: "Export",
          title: "Export",
          onClick: openDownloadTaskpane
        }
      ),
      imported ? /* @__PURE__ */ import_react90.default.createElement(DropdownItem_default, { key: "Change Import", title: "Change Import", onClick: () => {
        props.closeOpenEditingPopups();
        props.setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenTaskpane: {
              type: "UpdateImports" /* UPDATEIMPORTS */
            }
          });
        });
      } }) : void 0,
      /* @__PURE__ */ import_react90.default.createElement(DropdownSectionSeperator_default, { key: "sep", isDropdownSectionSeperator: true }),
      /* @__PURE__ */ import_react90.default.createElement(
        DropdownItem_default,
        {
          key: "Duplicate",
          title: "Duplicate",
          onClick: onDuplicate
        }
      ),
      /* @__PURE__ */ import_react90.default.createElement(
        DropdownItem_default,
        {
          key: "Rename",
          title: "Rename",
          onClick: onRename,
          supressFocusSettingOnClose: true
        }
      ),
      /* @__PURE__ */ import_react90.default.createElement(
        DropdownItem_default,
        {
          key: "Delete",
          title: "Delete",
          onClick: (e) => {
            e == null ? void 0 : e.stopPropagation();
            void onDelete();
          }
        }
      )
    ].filter((element) => element !== null && element !== void 0);
    return /* @__PURE__ */ import_react90.default.createElement(
      Dropdown_default,
      {
        display: props.display,
        closeDropdown: () => props.setDisplayActions(false),
        width: "medium"
      },
      dropdownItems
    );
  }

  // src/components/footer/GraphSheetTabActions.tsx
  var import_react91 = __toESM(require_react());
  function GraphSheetTabActions(props) {
    (0, import_react91.useEffect)(() => {
      if (props.display) {
        void props.mitoAPI.log(
          "clicked_graph_sheet_tab_actions",
          {
            graph_id: props.graphID
          }
        );
      }
    }, [props.display]);
    const onDelete = async () => {
      props.closeOpenEditingPopups();
      await props.mitoAPI.editGraphDelete(props.graphID);
    };
    const onDuplicate = async () => {
      props.closeOpenEditingPopups();
      const newGraphID = getRandomId();
      await props.mitoAPI.editGraphDuplicate(props.graphID, newGraphID);
    };
    const onRename = () => {
      props.setIsRename(true);
    };
    const openExportGraphTaskpaneTab = async () => {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: {
            type: "graph" /* GRAPH */,
            graphID: props.graphID,
            graphSidebarTab: "export" /* Export */
          }
        });
      });
    };
    return /* @__PURE__ */ import_react91.default.createElement(
      Dropdown_default,
      {
        display: props.display,
        closeDropdown: () => props.setDisplayActions(false),
        width: "small"
      },
      /* @__PURE__ */ import_react91.default.createElement(
        DropdownItem_default,
        {
          title: "Export",
          onClick: (e) => {
            e == null ? void 0 : e.stopPropagation();
            void openExportGraphTaskpaneTab();
          }
        }
      ),
      /* @__PURE__ */ import_react91.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ import_react91.default.createElement(
        DropdownItem_default,
        {
          title: "Duplicate",
          onClick: onDuplicate
        }
      ),
      /* @__PURE__ */ import_react91.default.createElement(
        DropdownItem_default,
        {
          title: "Rename",
          onClick: onRename,
          supressFocusSettingOnClose: true
        }
      ),
      /* @__PURE__ */ import_react91.default.createElement(
        DropdownItem_default,
        {
          title: "Delete",
          onClick: (e) => {
            e == null ? void 0 : e.stopPropagation();
            void onDelete();
          }
        }
      )
    );
  }

  // src/components/footer/SheetTab.tsx
  var selectPreviousGraphSheetTab = (graphDataDict, prevGraphIndex, setUIState) => {
    const graphIDs = Object.keys(graphDataDict || {});
    let newGraphID = void 0;
    if (graphIDs.length > prevGraphIndex) {
      newGraphID = graphIDs[prevGraphIndex];
    } else if (graphIDs.length > 0) {
      newGraphID = graphIDs[prevGraphIndex - 1];
    }
    if (newGraphID !== void 0) {
      const _newGraphID = newGraphID;
      setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          selectedGraphID: _newGraphID,
          selectedTabType: "graph",
          currOpenTaskpane: { type: "graph" /* GRAPH */, graphID: _newGraphID }
        });
      });
      return _newGraphID;
    } else {
      setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          selectedGraphID: void 0,
          selectedTabType: "data",
          currOpenTaskpane: { type: "none" /* NONE */ }
        });
      });
      return void 0;
    }
  };
  function SheetTab(props) {
    const openDropdownDivRef = (0, import_react92.useRef)(null);
    const [displayActions, setDisplayActions] = (0, import_react92.useState)(false);
    const [isRename, setIsRename] = (0, import_react92.useState)(false);
    const [newTabName, setNewTabName] = (0, import_react92.useState)(props.tabName);
    (0, import_react92.useEffect)(() => {
      setNewTabName(props.tabName);
    }, [props.tabName]);
    const onRename = async () => {
      var _a;
      void props.closeOpenEditingPopups();
      if (props.tabIDObj.tabType === "data") {
        await props.mitoAPI.editDataframeRename(
          props.tabIDObj.sheetIndex,
          newTabName
        );
      } else {
        await props.mitoAPI.editGraphRename(
          props.tabIDObj.graphID,
          newTabName
        );
      }
      setDisplayActions(false);
      setIsRename(false);
      const endoGridContainer = (_a = props.mitoContainerRef.current) == null ? void 0 : _a.querySelector(".endo-grid-container");
      focusGrid(endoGridContainer);
    };
    return /* @__PURE__ */ import_react92.default.createElement(
      "div",
      {
        className: classNames("tab", { "tab-graph": props.tabIDObj.tabType === "graph" }, { "tab-selected": props.isSelectedTab }, "cursor-pointer"),
        onClick: () => {
          if (props.tabIDObj.tabType === "graph") {
            props.setEditorState(void 0);
          }
          props.setUIState((prevUIState) => {
            if (props.tabIDObj.tabType === "data") {
              const taskpaneInfo = prevUIState.currOpenTaskpane.type === "graph" /* GRAPH */ ? { type: "none" /* NONE */ } : prevUIState.currOpenTaskpane;
              return __spreadProps(__spreadValues({}, prevUIState), {
                selectedTabType: "data",
                selectedSheetIndex: props.tabIDObj.sheetIndex,
                currOpenTaskpane: taskpaneInfo
              });
            } else {
              return __spreadProps(__spreadValues({}, prevUIState), {
                selectedTabType: "graph",
                selectedGraphID: props.tabIDObj.graphID,
                currOpenModal: { type: "None" /* None */ },
                currOpenTaskpane: {
                  type: "graph" /* GRAPH */,
                  graphID: props.tabIDObj.graphID
                }
              });
            }
          });
        },
        onDoubleClick: () => {
          setIsRename(true);
        },
        onContextMenu: (e) => {
          var _a;
          e.preventDefault();
          (_a = openDropdownDivRef.current) == null ? void 0 : _a.click();
        }
      },
      /* @__PURE__ */ import_react92.default.createElement("div", { className: "tab-content" }, props.tabIDObj.tabType === "graph" && /* @__PURE__ */ import_react92.default.createElement("div", { className: "mr-3px" }, /* @__PURE__ */ import_react92.default.createElement(GraphIcon_default, { variant: props.isSelectedTab ? "light" : void 0 })), isRename && /* @__PURE__ */ import_react92.default.createElement(
        "form",
        {
          onSubmit: async (e) => {
            e.preventDefault();
            await onRename();
          },
          onBlur: onRename
        },
        /* @__PURE__ */ import_react92.default.createElement(
          Input_default,
          {
            value: newTabName,
            onChange: (e) => {
              setNewTabName(e.target.value);
            },
            autoFocus: true,
            onEscape: () => {
              setIsRename(false);
              setNewTabName(props.tabName);
            }
          }
        )
      ), !isRename && /* @__PURE__ */ import_react92.default.createElement("p", null, props.tabName), /* @__PURE__ */ import_react92.default.createElement(
        "div",
        {
          ref: openDropdownDivRef,
          className: "sheet-tab-dropdown-button-div",
          onClick: () => {
            setDisplayActions(true);
          }
        },
        props.isSelectedTab ? /* @__PURE__ */ import_react92.default.createElement(SelectedSheetTabDropdownIcon_default, null) : /* @__PURE__ */ import_react92.default.createElement(UnselectedSheetTabDropdownIcon_default, null)
      )),
      props.tabIDObj.tabType === "data" && /* @__PURE__ */ import_react92.default.createElement(
        SheetTabActions,
        {
          setDisplayActions,
          setUIState: props.setUIState,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          setIsRename,
          sheetIndex: props.tabIDObj.sheetIndex,
          mitoAPI: props.mitoAPI,
          graphDataDict: props.graphDataDict,
          sheetDataArray: props.sheetDataArray,
          display: displayActions && props.tabIDObj.tabType === "data"
        }
      ),
      props.tabIDObj.tabType === "graph" && /* @__PURE__ */ import_react92.default.createElement(
        GraphSheetTabActions,
        {
          setDisplayActions,
          setUIState: props.setUIState,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          setIsRename,
          graphID: props.tabIDObj.graphID,
          mitoAPI: props.mitoAPI,
          graphDataDict: props.graphDataDict,
          display: displayActions && props.tabIDObj.tabType === "graph"
        }
      )
    );
  }

  // src/components/icons/PlusIcon.tsx
  var import_react93 = __toESM(require_react());
  var PlusIcon = () => {
    return /* @__PURE__ */ import_react93.default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react93.default.createElement("path", { d: "M7.0498 1.66016V13.7602", stroke: "#494650", strokeWidth: "2", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react93.default.createElement("path", { d: "M13.1 7.71008H1", stroke: "#494650", strokeWidth: "2", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var PlusIcon_default = PlusIcon;

  // src/components/footer/Footer.tsx
  function Footer(props) {
    const selectedSheetIndex = props.uiState.selectedSheetIndex;
    const selectedGraphID = props.uiState.selectedGraphID;
    const selectedTabType = props.uiState.selectedTabType;
    const sheetIndex = selectedTabType === "graph" && selectedGraphID !== void 0 && props.graphDataDict[selectedGraphID] !== void 0 ? props.graphDataDict[selectedGraphID].graphParams.graphCreation.sheet_index : selectedSheetIndex;
    const sheetData = props.sheetDataArray[sheetIndex];
    const disabledDueToReplayAnalysis = props.uiState.currOpenTaskpane.type === "UpdateImports" /* UPDATEIMPORTS */ && props.uiState.currOpenTaskpane.failedReplayData !== void 0;
    return /* @__PURE__ */ import_react94.default.createElement("div", { className: "footer" }, /* @__PURE__ */ import_react94.default.createElement(
      "div",
      {
        className: classNames("footer-add-button", "cursor-pointer"),
        onClick: () => {
          if (disabledDueToReplayAnalysis) {
            return;
          }
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "import files" /* IMPORT_FILES */ }
            });
          });
        }
      },
      /* @__PURE__ */ import_react94.default.createElement(PlusIcon_default, null)
    ), /* @__PURE__ */ import_react94.default.createElement("div", { className: "footer-tab-bar scrollbar-gutter" }, props.sheetDataArray.map((df) => df.dfName).map((dfName, idx) => {
      return /* @__PURE__ */ import_react94.default.createElement(
        SheetTab,
        {
          key: idx,
          tabName: dfName,
          tabIDObj: { tabType: "data", sheetIndex: idx },
          isSelectedTab: selectedTabType === "data" && idx === selectedSheetIndex,
          setUIState: props.setUIState,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          mitoAPI: props.mitoAPI,
          mitoContainerRef: props.mitoContainerRef,
          graphDataDict: props.graphDataDict,
          sheetDataArray: props.sheetDataArray,
          setEditorState: props.setEditorState
        }
      );
    }), Object.entries(props.graphDataDict || {}).map(([graphID, graphData]) => {
      return /* @__PURE__ */ import_react94.default.createElement(
        SheetTab,
        {
          key: graphID,
          tabName: graphData.graphTabName,
          tabIDObj: { tabType: "graph", graphID },
          isSelectedTab: selectedTabType === "graph" && graphID === selectedGraphID,
          setUIState: props.setUIState,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          mitoAPI: props.mitoAPI,
          mitoContainerRef: props.mitoContainerRef,
          graphDataDict: props.graphDataDict,
          sheetDataArray: props.sheetDataArray,
          setEditorState: props.setEditorState
        }
      );
    })), sheetData !== void 0 && /* @__PURE__ */ import_react94.default.createElement("div", { className: "footer-right-side" }, /* @__PURE__ */ import_react94.default.createElement("div", { className: "footer-sheet-shape" }, "(", sheetData.numRows, " rows, ", sheetData.numColumns, " cols)")));
  }
  var Footer_default = Footer;

  // src/components/modals/ClearAnalysisModal.tsx
  var import_react96 = __toESM(require_react());

  // src/components/DefaultModal.tsx
  var import_react95 = __toESM(require_react());
  var DefaultModal = (props) => {
    const headerColor = props.modalType === "Error" /* Error */ ? "#ED4747" : "#343434";
    const displayOverlay = props.overlay !== void 0 && props.overlay;
    return /* @__PURE__ */ import_react95.default.createElement("div", { className: classNames({ "mito-modal-container": !displayOverlay }, { "overlay": displayOverlay }) }, /* @__PURE__ */ import_react95.default.createElement("div", { className: classNames({ "mito-modal-container": displayOverlay }) }, /* @__PURE__ */ import_react95.default.createElement("div", { className: classNames("mito-modal", { "modal-wide": props.wide }) }, props.setUIState !== void 0 && /* @__PURE__ */ import_react95.default.createElement(Row_default, { justify: "end" }, /* @__PURE__ */ import_react95.default.createElement(Col_default, { offsetRight: 0.25 }, /* @__PURE__ */ import_react95.default.createElement(
      "div",
      {
        className: "default-taskpane-header-exit-button-div",
        onClick: () => {
          if (props.setUIState != void 0) {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenModal: { type: "None" /* None */ }
              });
            });
          }
        }
      },
      /* @__PURE__ */ import_react95.default.createElement(XIcon_default, null)
    ))), /* @__PURE__ */ import_react95.default.createElement("div", { className: classNames("mito-modal-header-text-div", { "mt-25px": props.setUIState === void 0 }), style: { color: headerColor } }, /* @__PURE__ */ import_react95.default.createElement("p", { className: "text-align-center-important" }, props.header)), props.viewComponent && /* @__PURE__ */ import_react95.default.createElement("div", { className: "mito-modal-message" }, props.viewComponent), /* @__PURE__ */ import_react95.default.createElement("div", { className: "mito-modal-buttons" }, props.buttons))));
  };
  var DefaultModal_default = DefaultModal;

  // src/components/modals/ClearAnalysisModal.tsx
  var ClearAnalysisModal = (props) => {
    (0, import_react96.useEffect)(() => {
      void props.mitoAPI.log("click_open_clear_analysis");
    }, []);
    const clickClear = async () => {
      void props.mitoAPI.updateClear();
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenModal: { type: "None" /* None */ }
        });
      });
    };
    return /* @__PURE__ */ import_react96.default.createElement(
      DefaultModal_default,
      {
        header: `Clear your current analysis?`,
        modalType: "ClearAnalysis" /* ClearAnalysis */,
        viewComponent: /* @__PURE__ */ import_react96.default.createElement(import_react96.default.Fragment, null, /* @__PURE__ */ import_react96.default.createElement("p", { className: "body-text-1" }, "This will undo all transformations and you've made to imported dataframes and delete all of the graphs you've created.")),
        buttons: /* @__PURE__ */ import_react96.default.createElement(import_react96.default.Fragment, null, /* @__PURE__ */ import_react96.default.createElement(
          TextButton_default,
          {
            variant: "light",
            width: "small",
            onClick: () => {
              props.setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenModal: { type: "None" /* None */ }
                });
              });
            }
          },
          "Close"
        ), /* @__PURE__ */ import_react96.default.createElement(
          TextButton_default,
          {
            variant: "dark",
            width: "small",
            onClick: clickClear
          },
          "Clear"
        ))
      }
    );
  };
  var ClearAnalysisModal_default = ClearAnalysisModal;

  // src/components/modals/DeleteGraphsModal.tsx
  var import_react97 = __toESM(require_react());
  var DeleteGraphsModal = (props) => {
    const graphIDs = props.dependantGraphTabNamesAndIDs.map((graphTabNameAndID) => {
      return graphTabNameAndID.graphID;
    });
    const graphTabNames = props.dependantGraphTabNamesAndIDs.map((graphTabNameAndID) => {
      return graphTabNameAndID.graphTabName;
    });
    const clickDelete = async () => {
      graphIDs.forEach((graphID) => {
        void props.mitoAPI.editGraphDelete(graphID);
      });
      await props.mitoAPI.editDataframeDelete(props.sheetIndex);
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          selectedTabType: "data",
          selectedSheetIndex: prevUIState.selectedSheetIndex > 0 ? prevUIState.selectedSheetIndex - 1 : 0,
          currOpenModal: { type: "None" /* None */ },
          currOpenTaskpane: { type: "none" /* NONE */ }
        });
      });
    };
    return /* @__PURE__ */ import_react97.default.createElement(
      DefaultModal_default,
      {
        header: `Delete Sheet and Dependant Graphs`,
        modalType: "ClearAnalysis" /* ClearAnalysis */,
        viewComponent: /* @__PURE__ */ import_react97.default.createElement(import_react97.default.Fragment, null, /* @__PURE__ */ import_react97.default.createElement("p", { className: "body-text-1" }, "Deleting ", props.dfName, " will delete the following graphs that rely on it:\xA0", /* @__PURE__ */ import_react97.default.createElement("span", { className: "text-color-mito-purple-important" }, graphTabNames.join(", ")))),
        buttons: /* @__PURE__ */ import_react97.default.createElement(import_react97.default.Fragment, null, /* @__PURE__ */ import_react97.default.createElement(
          TextButton_default,
          {
            variant: "light",
            width: "small",
            onClick: () => {
              props.setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenModal: { type: "None" /* None */ }
                });
              });
            }
          },
          "Close"
        ), /* @__PURE__ */ import_react97.default.createElement(
          TextButton_default,
          {
            variant: "dark",
            width: "large",
            onClick: clickDelete
          },
          "Delete Sheet and Graphs"
        ))
      }
    );
  };
  var DeleteGraphsModal_default = DeleteGraphsModal;

  // src/components/modals/ErrorModal.tsx
  var import_react98 = __toESM(require_react());
  var ErrorModal = (props) => {
    const [viewTraceback, setViewTraceback] = (0, import_react98.useState)(false);
    if (props.error === void 0) {
      return /* @__PURE__ */ import_react98.default.createElement(import_react98.default.Fragment, null);
    }
    return /* @__PURE__ */ import_react98.default.createElement(
      DefaultModal_default,
      {
        header: props.error.header,
        modalType: "Error" /* Error */,
        wide: true,
        viewComponent: /* @__PURE__ */ import_react98.default.createElement(import_react98.Fragment, null, props.error.to_fix && /* @__PURE__ */ import_react98.default.createElement("div", { className: "text-align-left text-body-1", onClick: () => setViewTraceback((viewTraceback2) => !viewTraceback2) }, props.error.to_fix, " ", " ", props.error.traceback && /* @__PURE__ */ import_react98.default.createElement("span", { className: "text-body-1-link" }, "Click to view full traceback.")), props.error.traceback && viewTraceback && /* @__PURE__ */ import_react98.default.createElement("div", { className: "flex flex-column text-align-left text-overflow-hidden text-overflow-scroll mt-5px", style: { height: "200px", border: "1px solid var(--mito-purple)", borderRadius: "2px", padding: "5px" } }, /* @__PURE__ */ import_react98.default.createElement("pre", null, props.error.traceback))),
        buttons: /* @__PURE__ */ import_react98.default.createElement(import_react98.Fragment, null, /* @__PURE__ */ import_react98.default.createElement(
          TextButton_default,
          {
            variant: "light",
            width: "small",
            onClick: () => {
              props.setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenModal: { type: "None" /* None */ }
                });
              });
            }
          },
          "Close"
        ), /* @__PURE__ */ import_react98.default.createElement(
          GetSupportButton_default,
          {
            userProfile: props.userProfile,
            setUIState: props.setUIState,
            mitoAPI: props.mitoAPI
          }
        ))
      }
    );
  };
  var ErrorModal_default = ErrorModal;

  // src/components/modals/ReplayAnalysisModals.tsx
  var import_react99 = __toESM(require_react());
  var ErrorReplayedAnalysisModal = (props) => {
    var _a, _b;
    const [viewTraceback, setViewTraceback] = (0, import_react99.useState)(false);
    return /* @__PURE__ */ import_react99.default.createElement(
      DefaultModal_default,
      {
        header: props.header,
        modalType: "Error" /* Error */,
        wide: true,
        viewComponent: /* @__PURE__ */ import_react99.default.createElement(import_react99.Fragment, null, /* @__PURE__ */ import_react99.default.createElement("div", { className: "text-align-left text-body-1", onClick: () => setViewTraceback((viewTraceback2) => !viewTraceback2) }, props.message, " ", " ", ((_a = props.error) == null ? void 0 : _a.traceback) && /* @__PURE__ */ import_react99.default.createElement("span", { className: "text-body-1-link" }, "Click to view full traceback.")), ((_b = props.error) == null ? void 0 : _b.traceback) && viewTraceback && /* @__PURE__ */ import_react99.default.createElement("div", { className: "flex flex-column text-align-left text-overflow-hidden text-overflow-scroll mt-5px", style: { height: "200px", border: "1px solid var(--mito-purple)", borderRadius: "2px", padding: "5px" } }, /* @__PURE__ */ import_react99.default.createElement("pre", null, props.error.traceback))),
        buttons: /* @__PURE__ */ import_react99.default.createElement(import_react99.default.Fragment, null, /* @__PURE__ */ import_react99.default.createElement(
          GetSupportButton_default,
          {
            userProfile: props.userProfile,
            setUIState: props.setUIState,
            mitoAPI: props.mitoAPI
          }
        ), /* @__PURE__ */ import_react99.default.createElement(
          TextButton_default,
          {
            variant: "dark",
            width: "medium",
            onClick: () => {
              overwriteAnalysisToReplayToMitosheetCall(
                props.oldAnalysisName,
                props.newAnalysisName,
                props.mitoAPI
              );
              props.setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenModal: { type: "None" /* None */ }
                });
              });
            }
          },
          "Start New Analysis"
        ))
      }
    );
  };
  var ReplayAnalysisModals_default = ErrorReplayedAnalysisModal;

  // src/components/modals/SignupModal.tsx
  var import_react103 = __toESM(require_react());

  // src/components/icons/mitofolks/BlueMitoFolk.tsx
  var React97 = __toESM(require_react());
  var BlueMitoFolk = () => /* @__PURE__ */ React97.createElement(
    "svg",
    {
      width: 172,
      height: 129,
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      style: { transform: "scale(1.25)", "margin": "100px 75px" },
      onClick: () => {
        window.open("https://github.com/mito-ds/monorepo", "_blank");
      }
    },
    /* @__PURE__ */ React97.createElement("g", { clipPath: "url(#a)" }, /* @__PURE__ */ React97.createElement("path", { d: "m52.592 32.185 31.38 22.609", stroke: "#000", strokeWidth: 5.525 }), /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "M79.438 84.58c-1.068-1.98-1.891-4.396-2.479-7.127-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.818 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.05l.04-.048.02-.056c2.375-6.458 7.575-11.181 13.626-13.934 6.054-2.754 12.93-3.521 18.62-2.094 2.777.697 5.27 1.914 7.252 3.68-2.873-1.34-6.039-2.195-9.28-2.604-6.903-.872-14.187.276-19.779 3.142-5.56 2.85-9.482 7.422-9.611 13.412-5.937 7.152-9.74 20.31-10.638 32.729-.452 6.245-.171 12.33.954 17.4.466 2.101 1.08 4.038 1.85 5.744Zm3.742 4.29c-2.281-2.203-3.896-5.77-4.876-10.184-1.107-4.994-1.389-11.012-.94-17.213.898-12.42 4.714-25.469 10.557-32.434l.08-.094v-.12c.076-5.724 3.79-10.138 9.224-12.923 5.439-2.787 12.563-3.918 19.329-3.063 3.89.49 7.648 1.636 10.892 3.488 1.298 1.592 2.257 3.514 2.772 5.776 1.372 6.027-.384 14.546-7.397 25.818l-.045.073-.006.083c-.23 3.636-.193 7.135-.141 10.484l.013.754c.05 3.08.098 6.027-.053 8.854-.324 6.1-1.572 11.59-5.684 16.501-9.401 8.78-22.752 9.205-33.725 4.2Zm24.883 3.86c-8.329 1.638-16.88 1.235-22.595-2.16 10.65 3.913 23.028 2.933 31.965-5.427l.016-.014.014-.017c4.26-5.078 5.53-10.742 5.858-16.918.152-2.85.104-5.82.054-8.894-.004-.252-.009-.505-.012-.76-.053-3.322-.089-6.77.134-10.347 7.018-11.306 8.862-19.987 7.438-26.244a14.89 14.89 0 0 0-1.878-4.614c1.739 1.19 3.292 2.613 4.587 4.277 3.954 5.078 5.559 12.459 2.702 22.506-1.001 2.801-1.353 5.922-1.463 9.17-.068 2.006-.043 4.08-.018 6.165.016 1.286.031 2.576.025 3.856-.033 6.75-.669 13.312-4.946 18.411-4.289 5.113-12.883 9.238-21.881 11.01Z",
        fill: "#00090F"
      }
    ), /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "M79.438 84.58c-1.068-1.98-1.891-4.396-2.479-7.127-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.818 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.05l.04-.048.02-.056c2.375-6.458 7.575-11.181 13.626-13.934 6.054-2.754 12.93-3.521 18.62-2.094 2.777.697 5.27 1.914 7.252 3.68-2.873-1.34-6.039-2.195-9.28-2.604-6.903-.872-14.187.276-19.779 3.142-5.56 2.85-9.482 7.422-9.611 13.412-5.937 7.152-9.74 20.31-10.638 32.729-.452 6.245-.171 12.33.954 17.4.466 2.101 1.08 4.038 1.85 5.744Zm3.742 4.29c-2.281-2.203-3.896-5.77-4.876-10.184-1.107-4.994-1.389-11.012-.94-17.213.898-12.42 4.714-25.469 10.557-32.434l.08-.094v-.12c.076-5.724 3.79-10.138 9.224-12.923 5.439-2.787 12.563-3.918 19.329-3.063 3.89.49 7.648 1.636 10.892 3.488 1.298 1.592 2.257 3.514 2.772 5.776 1.372 6.027-.384 14.546-7.397 25.818l-.045.073-.006.083c-.23 3.636-.193 7.135-.141 10.484l.013.754c.05 3.08.098 6.027-.053 8.854-.324 6.1-1.572 11.59-5.684 16.501-9.401 8.78-22.752 9.205-33.725 4.2Zm24.883 3.86c-8.329 1.638-16.88 1.235-22.595-2.16 10.65 3.913 23.028 2.933 31.965-5.427l.016-.014.014-.017c4.26-5.078 5.53-10.742 5.858-16.918.152-2.85.104-5.82.054-8.894-.004-.252-.009-.505-.012-.76-.053-3.322-.089-6.77.134-10.347 7.018-11.306 8.862-19.987 7.438-26.244a14.89 14.89 0 0 0-1.878-4.614c1.739 1.19 3.292 2.613 4.587 4.277 3.954 5.078 5.559 12.459 2.702 22.506-1.001 2.801-1.353 5.922-1.463 9.17-.068 2.006-.043 4.08-.018 6.165.016 1.286.031 2.576.025 3.856-.033 6.75-.669 13.312-4.946 18.411-4.289 5.113-12.883 9.238-21.881 11.01Z",
        fill: "url(#b)"
      }
    ), /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "M127.446 16.327c-3.244-1.852-7.002-2.997-10.892-3.488-6.766-.855-13.89.276-19.329 3.063-5.434 2.785-9.148 7.199-9.223 12.924l-.002.119-.079.093c-5.843 6.966-9.659 20.016-10.557 32.435-.449 6.201-.167 12.22.94 17.213.98 4.414 2.595 7.981 4.876 10.185 10.973 5.004 24.324 4.579 33.725-4.2 4.112-4.911 5.36-10.401 5.684-16.502.151-2.827.103-5.774.053-8.854l-.013-.754c-.052-3.35-.089-6.848.141-10.484l.006-.083.045-.073c7.013-11.272 8.769-19.79 7.397-25.817-.515-2.263-1.474-4.185-2.772-5.777Zm0 0c.844 1.351 3.096 3.896 3.489 5.622 1.424 6.257-.42 14.938-7.438 26.244-.223 3.577-.187 7.025-.134 10.348.003.254.008.507.012.76.05 3.073.098 6.043-.054 8.893-.328 6.176-1.598 11.84-5.858 16.918l-.014.017-.016.014c-8.937 8.36-21.315 9.34-31.965 5.426 5.714 3.396 14.266 3.799 22.595 2.16 8.998-1.77 17.592-5.896 21.881-11.009 4.278-5.1 4.913-11.662 4.946-18.411.006-1.28-.009-2.57-.025-3.856-.025-2.085-.05-4.16.018-6.165.11-3.248.462-6.369 1.463-9.17 2.857-10.047 1.252-17.428-2.702-22.506-1.295-1.663-4.459-4.094-6.198-5.285ZM79.438 84.58c-1.068-1.98-1.891-4.396-2.479-7.127-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.818 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.05l.04-.048.02-.056c2.375-6.458 7.575-11.181 13.626-13.934 6.054-2.754 12.93-3.521 18.62-2.094 2.777.697 5.27 1.914 7.252 3.68-2.873-1.34-6.039-2.195-9.28-2.604-6.903-.872-14.187.276-19.779 3.142-5.56 2.85-9.482 7.422-9.611 13.412-5.937 7.152-9.74 20.31-10.638 32.729-.452 6.245-.171 12.33.954 17.4.466 2.101 1.08 4.038 1.85 5.744Z",
        stroke: "#000",
        strokeWidth: 1.105
      }
    ), /* @__PURE__ */ React97.createElement("g", { filter: "url(#c)" }, /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "M123.137 48.094c-.921 14.487 2.423 26.813-5.96 36.805-9.657 9.033-23.41 9.346-34.564 4.096-11.757-8.734-7.874-48.46 3.484-61.999C95.75.75 151.273 2.868 123.137 48.094Z",
        fill: "#0081DE"
      }
    ), /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "m122.821 47.922-.045.072-.006.084c-.23 3.636-.193 7.134-.141 10.483l.013.755c.05 3.079.098 6.027-.053 8.854-.324 6.1-1.572 11.59-5.684 16.5-9.506 8.878-23.051 9.214-34.092 4.031-2.822-2.113-4.751-6.124-5.854-11.247-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.819 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.051l.04-.047.02-.056c2.375-6.458 7.575-11.182 13.626-13.934 6.054-2.755 12.93-3.522 18.62-2.094 5.676 1.423 10.163 5.024 11.529 11.026 1.372 6.027-.384 14.546-7.397 25.818Z",
        stroke: "#000",
        strokeWidth: 1.105
      }
    )), /* @__PURE__ */ React97.createElement("g", { filter: "url(#d)" }, /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "m85.013 75.222 26.868-2.453",
        stroke: "#3B6787",
        strokeWidth: 1.104
      }
    )), /* @__PURE__ */ React97.createElement("g", { filter: "url(#e)" }, /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "m86.003 65.37 23.79-1.938",
        stroke: "#3B6787",
        strokeWidth: 1.104
      }
    )), /* @__PURE__ */ React97.createElement("g", { filter: "url(#f)" }, /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "m88.856 55.66 23.79-1.938",
        stroke: "#3B6787",
        strokeWidth: 1.104
      }
    )), /* @__PURE__ */ React97.createElement("g", { filter: "url(#g)" }, /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "m91.344 45.99 23.79-1.938",
        stroke: "#3B6787",
        strokeWidth: 1.104
      }
    )), /* @__PURE__ */ React97.createElement("g", { filter: "url(#h)" }, /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "m88.096 80.49 12.163-41.706",
        stroke: "#3B6787",
        strokeWidth: 1.104
      }
    )), /* @__PURE__ */ React97.createElement("g", { filter: "url(#i)" }, /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "m97.642 82.913 12.163-41.707",
        stroke: "#3B6787",
        strokeWidth: 1.104
      }
    )), /* @__PURE__ */ React97.createElement("path", { d: "m109.5 23-2 1 .5 2", stroke: "#000" }), /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "M102.743 33.484c1.514.834 3.574.173 4.6-1.477 1.025-1.65.629-3.663-.886-4.497-1.514-.834-3.574-.173-4.6 1.477-1.025 1.65-.629 3.663.886 4.497Z",
        fill: "#000"
      }
    ), /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "m88.975 91.492-10.787 33.683M110.007 92.21l15.69 35.99M123.199 47.411l31.38 22.61",
        stroke: "#000",
        strokeWidth: 5.525
      }
    ), /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "M106.609 16.93c-1.961-.93-3.391-.23-4.422.383.325.705 1.311 2.276 2.656 2.914 1.345.638 3.436.803 4.349.41-.03-1.256-.734-2.83-2.583-3.707ZM117.727 20.447c-1.961-.93-3.391-.231-4.422.382.325.705 1.311 2.276 2.656 2.914 1.345.638 3.436.803 4.349.41-.03-1.255-.734-2.83-2.583-3.706Z",
        stroke: "#000",
        strokeWidth: 1.105
      }
    ), /* @__PURE__ */ React97.createElement(
      "mask",
      {
        id: "j",
        style: {
          maskType: "alpha"
        },
        maskUnits: "userSpaceOnUse",
        x: 103,
        y: 17,
        width: 3,
        height: 2
      },
      /* @__PURE__ */ React97.createElement(
        "path",
        {
          d: "M104.29 18.863c.484.23 1.073.047 1.317-.408.244-.455.05-1.01-.434-1.24-.484-.23-1.073-.046-1.317.409-.244.455-.049 1.01.434 1.24Z",
          fill: "#fff"
        }
      )
    ), /* @__PURE__ */ React97.createElement("g", { mask: "url(#j)" }, /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "M104.641 17.996a.166.166 0 0 1 .09-.077.09.09 0 0 1 .064.002l-1.01 1.885c.984.466 2.248.114 2.788-.893l-1.932-.917Zm.154-.075c.013.006.03.022.039.047a.15.15 0 0 1-.012.114l-1.932-.916c-.54 1.007-.089 2.173.895 2.64l1.01-1.885Zm.027.161a.163.163 0 0 1-.09.077.091.091 0 0 1-.064-.002l1.01-1.884c-.984-.467-2.248-.115-2.788.893l1.932.916Zm-.154.075a.083.083 0 0 1-.039-.047.15.15 0 0 1 .012-.114l1.932.917c.54-1.008.089-2.174-.895-2.64l-1.01 1.884Z",
        fill: "#000"
      }
    )), /* @__PURE__ */ React97.createElement(
      "mask",
      {
        id: "k",
        style: {
          maskType: "alpha"
        },
        maskUnits: "userSpaceOnUse",
        x: 115,
        y: 21,
        width: 3,
        height: 3
      },
      /* @__PURE__ */ React97.createElement(
        "path",
        {
          d: "M116.058 23.016c.484.229 1.073.046 1.317-.409.244-.455.049-1.01-.434-1.24-.484-.229-1.073-.046-1.317.41-.244.454-.05 1.01.434 1.239Z",
          fill: "#fff"
        }
      )
    ), /* @__PURE__ */ React97.createElement("g", { mask: "url(#k)" }, /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "M116.409 22.149a.163.163 0 0 1 .09-.077.091.091 0 0 1 .064.001l-1.01 1.885c.984.467 2.248.115 2.788-.893l-1.932-.916Zm.154-.076c.013.007.03.022.039.047a.15.15 0 0 1-.012.114l-1.932-.916c-.54 1.007-.089 2.173.895 2.64l1.01-1.885Zm.027.161a.166.166 0 0 1-.09.077.091.091 0 0 1-.064-.001l1.01-1.885c-.984-.467-2.249-.114-2.788.893l1.932.916Zm-.154.076a.084.084 0 0 1-.039-.047.15.15 0 0 1 .012-.114l1.932.916c.54-1.007.089-2.173-.895-2.64l-1.01 1.885Z",
        fill: "#000"
      }
    ))),
    /* @__PURE__ */ React97.createElement("rect", { y: 13, width: 100, height: 22, rx: 11, fill: "#000" }),
    /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "m13.5 18.118 1.208 3.719.113.345h4.273l-3.163 2.299-.294.213.112.346 1.208 3.719-3.163-2.299-.294-.213-.294.213-3.163 2.299 1.208-3.72.112-.345-.294-.213-3.163-2.299h4.273l.113-.345 1.208-3.719Z",
        stroke: "#9D6CFF"
      }
    ),
    /* @__PURE__ */ React97.createElement(
      "path",
      {
        d: "M27.65 27.6c1.58 0 2.63-.97 2.63-2.21 0-1.43-.87-1.91-2.55-2.14-1.24-.18-1.48-.47-1.48-1.05 0-.55.42-.94 1.23-.94.82 0 1.25.32 1.38 1.07h1.22c-.14-1.37-1.06-2.07-2.6-2.07-1.49 0-2.49.88-2.49 2.05 0 1.34.81 1.86 2.52 2.09 1.16.19 1.49.44 1.49 1.1 0 .66-.56 1.1-1.35 1.1-1.21 0-1.5-.6-1.59-1.32h-1.28c.1 1.35.92 2.32 2.87 2.32Zm5.598-.01c.37 0 .63-.06.82-.13v-.96c-.17.07-.35.1-.59.1-.38 0-.6-.21-.6-.67v-2.75h1.15v-.91h-1.15v-1.15h-1.21v1.15h-.7v.91h.7v2.86c0 .99.54 1.55 1.58 1.55Zm3.33.01c.8 0 1.26-.29 1.6-.74v.64h1.19v-3.43c0-1.43-.92-1.91-2.09-1.91s-2.14.51-2.24 1.73h1.17c.06-.52.37-.82 1-.82.71 0 .95.35.95 1.05v.27h-.65c-1.5 0-2.68.44-2.68 1.66 0 1.09.79 1.55 1.75 1.55Zm.29-.87c-.6 0-.84-.29-.84-.73 0-.64.59-.85 1.51-.85h.62v.52c0 .67-.55 1.06-1.29 1.06Zm3.887.77h1.21v-2.72c0-1.11.64-1.45 1.7-1.46v-1.13c-.88.01-1.37.4-1.7 1.06v-.98h-1.21v5.23Zm8.698-.84c-.92 0-1.45-.67-1.45-1.74v-.08c0-1.08.55-1.73 1.45-1.73.9 0 1.44.66 1.44 1.74v.07c0 1.07-.54 1.74-1.44 1.74Zm-.01.94c1.54 0 2.69-1.06 2.69-2.69v-.08c0-1.6-1.15-2.67-2.68-2.67-1.54 0-2.69 1.08-2.69 2.7v.08c0 1.59 1.14 2.66 2.68 2.66Zm3.783-.1h1.21v-3.08c0-.83.55-1.25 1.23-1.25.72 0 1.04.36 1.04 1.15v3.18h1.21v-3.29c0-1.44-.74-2.05-1.79-2.05-.86 0-1.44.43-1.69.94v-.83h-1.21v5.23Zm11.777.1c2.02 0 3.26-1.2 3.26-3.18v-.66h-3.11v1h1.8c-.04.99-.59 1.8-1.93 1.8-1.5 0-2.21-1.05-2.21-2.58v-.08c0-1.57.81-2.61 2.21-2.61.93 0 1.57.41 1.73 1.36h1.33c-.19-1.71-1.55-2.41-3.08-2.41-2.09 0-3.57 1.52-3.57 3.65v.08c0 2.11 1.28 3.63 3.57 3.63Zm4.474-.1h1.21v-5.23h-1.21v5.23Zm.59-6.09c.4 0 .72-.3.72-.69 0-.4-.32-.7-.72-.7-.4 0-.72.3-.72.7 0 .39.32.69.72.69Zm3.874 6.18c.37 0 .63-.06.82-.13v-.96c-.17.07-.35.1-.59.1-.38 0-.6-.21-.6-.67v-2.75h1.15v-.91h-1.15v-1.15h-1.21v1.15h-.7v.91h.7v2.86c0 .99.54 1.55 1.58 1.55Zm1.912-.09h1.21v-3.08c0-.83.55-1.25 1.23-1.25.72 0 1.04.36 1.04 1.15v3.18h1.21v-3.29c0-1.44-.74-2.05-1.79-2.05-.86 0-1.44.43-1.69.94v-3.25h-1.21v7.65Zm7.834.1c.85 0 1.4-.41 1.66-.92v.82h1.21v-5.23h-1.21v3.11c0 .83-.57 1.25-1.22 1.25-.7 0-1.03-.36-1.03-1.15v-3.21h-1.21v3.35c0 1.39.77 1.98 1.8 1.98Zm7.225 0c1.35 0 2.32-1.02 2.32-2.7v-.08c0-1.69-1.01-2.66-2.32-2.66-.77 0-1.42.45-1.71.95v-3.26h-1.21v7.65h1.21v-.84c.28.53.88.94 1.71.94Zm-.3-.96c-.88 0-1.45-.55-1.45-1.72v-.08c0-1.16.6-1.73 1.44-1.73.79 0 1.39.57 1.39 1.73v.08c0 1.12-.49 1.72-1.38 1.72Z",
        fill: "#fff"
      }
    ),
    /* @__PURE__ */ React97.createElement("defs", null, /* @__PURE__ */ React97.createElement(
      "filter",
      {
        id: "c",
        x: 70.865,
        y: 9.821,
        width: 64.757,
        height: 91.658,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ React97.createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ React97.createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ React97.createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ React97.createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ React97.createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ React97.createElement(
      "filter",
      {
        id: "d",
        x: 80.536,
        y: 72.219,
        width: 35.822,
        height: 12.392,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ React97.createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ React97.createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ React97.createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ React97.createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ React97.createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ React97.createElement(
      "filter",
      {
        id: "e",
        x: 81.533,
        y: 62.882,
        width: 32.731,
        height: 11.877,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ React97.createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ React97.createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ React97.createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ React97.createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ React97.createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ React97.createElement(
      "filter",
      {
        id: "f",
        x: 84.386,
        y: 53.173,
        width: 32.731,
        height: 11.877,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ React97.createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ React97.createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ React97.createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ React97.createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ React97.createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ React97.createElement(
      "filter",
      {
        id: "g",
        x: 86.874,
        y: 43.502,
        width: 32.731,
        height: 11.877,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ React97.createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ React97.createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ React97.createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ React97.createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ React97.createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ React97.createElement(
      "filter",
      {
        id: "h",
        x: 83.142,
        y: 38.646,
        width: 22.072,
        height: 50.822,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ React97.createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ React97.createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ React97.createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ React97.createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ React97.createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ React97.createElement(
      "filter",
      {
        id: "i",
        x: 92.688,
        y: 41.068,
        width: 22.072,
        height: 50.822,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ React97.createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ React97.createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ React97.createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ React97.createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ React97.createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ React97.createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ React97.createElement(
      "linearGradient",
      {
        id: "b",
        x1: 7984.7,
        y1: 6352.37,
        x2: 4940.57,
        y2: 5739.01,
        gradientUnits: "userSpaceOnUse"
      },
      /* @__PURE__ */ React97.createElement("stop", null),
      /* @__PURE__ */ React97.createElement("stop", { offset: 1, stopOpacity: 0 })
    ), /* @__PURE__ */ React97.createElement("clipPath", { id: "a" }, /* @__PURE__ */ React97.createElement("path", { fill: "#fff", transform: "translate(43)", d: "M0 0h129v129H0z" })))
  );
  var BlueMitoFolk_default = BlueMitoFolk;

  // src/components/icons/mitofolks/PinkMitoFolk.tsx
  var import_react100 = __toESM(require_react());
  var PinkMitoFolk = () => {
    return /* @__PURE__ */ import_react100.default.createElement("svg", { style: { transform: "scaleX(-1)", "margin": "75px 50px" }, width: "200", height: "200", viewBox: "0 0 139 152", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react100.default.createElement("line", { y1: "-2.5", x2: "44.7223", y2: "-2.5", transform: "matrix(0.282454 0.959281 0.969447 -0.245301 108.706 62.2981)", stroke: "black", strokeWidth: "5" }), /* @__PURE__ */ import_react100.default.createElement("line", { y1: "-2.5", x2: "37.8202", y2: "-2.5", transform: "matrix(0.30917 0.951007 0.96312 -0.269071 94.2115 113.51)", stroke: "black", strokeWidth: "5" }), /* @__PURE__ */ import_react100.default.createElement("line", { y1: "-2.5", x2: "42.026", y2: "-2.5", transform: "matrix(-0.404697 0.914451 0.934686 0.355474 60.7272 113.51)", stroke: "black", strokeWidth: "5" }), /* @__PURE__ */ import_react100.default.createElement("path", { d: "M97.8672 111.365C100.871 108.702 103.275 104.518 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C57.7945 13.7155 54.0217 15.2578 51.0118 17.7322C55.1783 16.0594 59.747 15.1514 64.3541 14.9237C73.2372 14.4847 82.2938 16.5731 88.9362 20.6196C95.5578 24.6534 99.8036 30.6525 99.0257 38.0331C102.249 42.7078 104.564 49.1922 105.982 56.4278C107.408 63.705 107.929 71.7591 107.544 79.5305C107.159 87.301 105.867 94.7978 103.661 100.958C102.162 105.146 100.234 108.733 97.8672 111.365ZM95.2952 113.082C98.6041 110.526 101.236 106.2 103.172 100.792C105.359 94.6841 106.645 87.2331 107.029 79.4942C107.413 71.7562 106.893 63.7394 105.475 56.5022C104.057 49.2615 101.741 42.8184 98.5454 38.2157L98.4942 38.142L98.5037 38.0558C99.2981 30.8695 95.1951 25.0019 88.6645 21.0235C82.1291 17.0422 73.1858 14.9727 64.3958 15.4071C59.3271 15.6576 54.3197 16.74 49.8606 18.7609C47.927 20.6396 46.3826 22.9672 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.4077 116.547 80.4686 118.31 95.2952 113.082ZM62.8353 115.579C73.9568 118.589 85.8248 118.727 93.7629 114.109C79.2069 118.663 62.7794 116.601 52.3142 105.004L52.3034 104.991L52.2942 104.978C47.6798 98.333 46.9349 91.2383 47.4651 83.573C47.71 80.0323 48.2278 76.3618 48.7647 72.5552C48.8087 72.2433 48.8528 71.9304 48.8969 71.6166C49.4773 67.4894 50.0564 63.1995 50.3218 58.7213C43.1139 44.0566 42.1191 33.1641 44.874 25.6005C45.7514 23.1915 47.0073 21.1253 48.5583 19.3861C45.7969 20.7884 43.2762 22.5738 41.1213 24.7697C35.2478 30.755 32.0615 39.8204 34.1633 52.5799C35.0021 56.12 34.973 60.0019 34.6133 64.0333C34.3912 66.5219 34.0413 69.0827 33.6891 71.6598C33.4713 73.2535 33.2526 74.8536 33.0628 76.4467C32.0655 84.8179 31.8563 93.0672 36.5571 99.8369C41.2648 106.617 51.622 112.545 62.8353 115.579Z", fill: "#00090F" }), /* @__PURE__ */ import_react100.default.createElement("path", { d: "M97.8672 111.365C100.871 108.702 103.275 104.518 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C57.7945 13.7155 54.0217 15.2578 51.0118 17.7322C55.1783 16.0594 59.747 15.1514 64.3541 14.9237C73.2372 14.4847 82.2938 16.5731 88.9362 20.6196C95.5578 24.6534 99.8036 30.6525 99.0257 38.0331C102.249 42.7078 104.564 49.1922 105.982 56.4278C107.408 63.705 107.929 71.7591 107.544 79.5305C107.159 87.301 105.867 94.7978 103.661 100.958C102.162 105.146 100.234 108.733 97.8672 111.365ZM95.2952 113.082C98.6041 110.526 101.236 106.2 103.172 100.792C105.359 94.6841 106.645 87.2331 107.029 79.4942C107.413 71.7562 106.893 63.7394 105.475 56.5022C104.057 49.2615 101.741 42.8184 98.5454 38.2157L98.4942 38.142L98.5037 38.0558C99.2981 30.8695 95.1951 25.0019 88.6645 21.0235C82.1291 17.0422 73.1858 14.9727 64.3958 15.4071C59.3271 15.6576 54.3197 16.74 49.8606 18.7609C47.927 20.6396 46.3826 22.9672 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.4077 116.547 80.4686 118.31 95.2952 113.082ZM62.8353 115.579C73.9568 118.589 85.8248 118.727 93.7629 114.109C79.2069 118.663 62.7794 116.601 52.3142 105.004L52.3034 104.991L52.2942 104.978C47.6798 98.333 46.9349 91.2383 47.4651 83.573C47.71 80.0323 48.2278 76.3618 48.7647 72.5552C48.8087 72.2433 48.8528 71.9304 48.8969 71.6166C49.4773 67.4894 50.0564 63.1995 50.3218 58.7213C43.1139 44.0566 42.1191 33.1641 44.874 25.6005C45.7514 23.1915 47.0073 21.1253 48.5583 19.3861C45.7969 20.7884 43.2762 22.5738 41.1213 24.7697C35.2478 30.755 32.0615 39.8204 34.1633 52.5799C35.0021 56.12 34.973 60.0019 34.6133 64.0333C34.3912 66.5219 34.0413 69.0827 33.6891 71.6598C33.4713 73.2535 33.2526 74.8536 33.0628 76.4467C32.0655 84.8179 31.8563 93.0672 36.5571 99.8369C41.2648 106.617 51.622 112.545 62.8353 115.579Z", fill: "url(#paint0_linear)" }), /* @__PURE__ */ import_react100.default.createElement("path", { d: "M97.8672 111.365C100.871 108.702 103.275 104.518 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C57.7945 13.7155 54.0217 15.2578 51.0118 17.7322C55.1783 16.0594 59.747 15.1514 64.3541 14.9237C73.2372 14.4847 82.2938 16.5731 88.9362 20.6196C95.5578 24.6534 99.8036 30.6525 99.0257 38.0331C102.249 42.7078 104.564 49.1922 105.982 56.4278C107.408 63.705 107.929 71.7591 107.544 79.5305C107.159 87.301 105.867 94.7978 103.661 100.958C102.162 105.146 100.234 108.733 97.8672 111.365ZM95.2952 113.082C98.6041 110.526 101.236 106.2 103.172 100.792C105.359 94.6841 106.645 87.2331 107.029 79.4942C107.413 71.7562 106.893 63.7394 105.475 56.5022C104.057 49.2615 101.741 42.8184 98.5454 38.2157L98.4942 38.142L98.5037 38.0558C99.2981 30.8695 95.1951 25.0019 88.6645 21.0235C82.1291 17.0422 73.1858 14.9727 64.3958 15.4071C59.3271 15.6576 54.3197 16.74 49.8606 18.7609C47.927 20.6396 46.3826 22.9672 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.4077 116.547 80.4686 118.31 95.2952 113.082ZM62.8353 115.579C73.9568 118.589 85.8248 118.727 93.7629 114.109C79.2069 118.663 62.7794 116.601 52.3142 105.004L52.3034 104.991L52.2942 104.978C47.6798 98.333 46.9349 91.2383 47.4651 83.573C47.71 80.0323 48.2278 76.3618 48.7647 72.5552C48.8087 72.2433 48.8528 71.9304 48.8969 71.6166C49.4773 67.4894 50.0564 63.1995 50.3218 58.7213C43.1139 44.0566 42.1191 33.1641 44.874 25.6005C45.7514 23.1915 47.0073 21.1253 48.5583 19.3861C45.7969 20.7884 43.2762 22.5738 41.1213 24.7697C35.2478 30.755 32.0615 39.8204 34.1633 52.5799C35.0021 56.12 34.973 60.0019 34.6133 64.0333C34.3912 66.5219 34.0413 69.0827 33.6891 71.6598C33.4713 73.2535 33.2526 74.8536 33.0628 76.4467C32.0655 84.8179 31.8563 93.0672 36.5571 99.8369C41.2648 106.617 51.622 112.545 62.8353 115.579Z", stroke: "black", strokeWidth: "0.5" }), /* @__PURE__ */ import_react100.default.createElement("g", { filter: "url(#filter0_d)" }, /* @__PURE__ */ import_react100.default.createElement("path", { d: "M50.5827 58.6809C49.5253 76.7216 43.3703 91.6895 52.5089 104.85C63.4182 116.939 80.8842 118.6 95.8988 113.127C112.216 103.39 113.383 53.7942 101 35.9614C92.7473 2.53842 21.7073 0.0230777 50.5827 58.6809Z", fill: "#FFEBEB" }), /* @__PURE__ */ import_react100.default.createElement("path", { d: "M50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.5237 116.675 80.8393 118.347 95.7767 112.909C99.7734 110.514 102.875 105.657 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C54.402 14.2799 48.056 18.3727 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846Z", stroke: "#0A0A0A", strokeWidth: "0.5" })), /* @__PURE__ */ import_react100.default.createElement("g", { filter: "url(#filter1_d)" }, /* @__PURE__ */ import_react100.default.createElement("line", { y1: "-0.125", x2: "26.0263", y2: "-0.125", transform: "matrix(-1.00036 -0.232717 -0.303964 0.923249 90.9426 103.996)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ import_react100.default.createElement("g", { filter: "url(#filter2_d)" }, /* @__PURE__ */ import_react100.default.createElement("line", { y1: "-0.125", x2: "26.6148", y2: "-0.125", transform: "matrix(-0.998412 -0.240755 -0.312384 0.920564 92.4263 92.9282)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ import_react100.default.createElement("g", { filter: "url(#filter3_d)" }, /* @__PURE__ */ import_react100.default.createElement("line", { y1: "-0.125", x2: "26.6148", y2: "-0.125", transform: "matrix(-0.998412 -0.240755 -0.312384 0.920564 91.7477 81.6816)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ import_react100.default.createElement("g", { filter: "url(#filter4_d)" }, /* @__PURE__ */ import_react100.default.createElement("line", { y1: "-0.125", x2: "26.6148", y2: "-0.125", transform: "matrix(-0.998412 -0.240755 -0.312384 0.920564 91.4735 70.5457)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ import_react100.default.createElement("g", { filter: "url(#filter5_d)" }, /* @__PURE__ */ import_react100.default.createElement("line", { y1: "-0.125", x2: "49.6473", y2: "-0.125", transform: "matrix(-0.056611 -0.972639 -1.01868 0.0895582 85.7439 108.932)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ import_react100.default.createElement("g", { filter: "url(#filter6_d)" }, /* @__PURE__ */ import_react100.default.createElement("line", { y1: "-0.125", x2: "49.0215", y2: "-0.125", transform: "matrix(-0.0447349 -0.972962 -1.01982 0.0794914 74.2345 109.899)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ import_react100.default.createElement("path", { d: "M77.5748 21.6128C81.1721 21.0053 83.1051 22.723 84.446 24.1319C83.5748 25.0968 81.2156 27.1306 78.7489 27.5472C76.2822 27.9638 72.8613 27.3151 71.5987 26.3018C72.2742 24.3479 74.1847 22.1854 77.5748 21.6128Z", stroke: "black" }), /* @__PURE__ */ import_react100.default.createElement("path", { d: "M77.1438 24.7826C77.2286 25.211 77.6735 25.4954 78.138 25.417C78.6025 25.3385 78.9097 24.9272 78.8249 24.4987C78.7401 24.0703 78.2952 23.7859 77.8307 23.8643C77.3662 23.9428 77.059 24.3541 77.1438 24.7826Z", stroke: "black", strokeWidth: "1.5" }), /* @__PURE__ */ import_react100.default.createElement("path", { d: "M56.7304 23.0188C60.3276 22.4113 62.2607 24.129 63.6015 25.5379C62.7303 26.5028 60.3711 28.5366 57.9044 28.9532C55.4378 29.3698 52.0168 28.7211 50.7542 27.7078C51.4297 25.7539 53.3402 23.5914 56.7304 23.0188Z", stroke: "black" }), /* @__PURE__ */ import_react100.default.createElement("path", { d: "M56.2062 26.2049C56.291 26.6334 56.7359 26.9177 57.2004 26.8393C57.6649 26.7609 57.9721 26.3496 57.8873 25.9211C57.8025 25.4926 57.3576 25.2083 56.8931 25.2867C56.4286 25.3651 56.1214 25.7765 56.2062 26.2049Z", stroke: "black", strokeWidth: "1.5" }), /* @__PURE__ */ import_react100.default.createElement("path", { d: "M70.9027 31.9832L74.8034 33.746L74.6873 36.5264", stroke: "black" }), /* @__PURE__ */ import_react100.default.createElement("ellipse", { rx: "5.52852", ry: "7.22499", transform: "matrix(-1.00798 0.230879 0.25069 0.931832 78.3648 46.1813)", fill: "#0B0B0B" }), /* @__PURE__ */ import_react100.default.createElement("line", { y1: "-2.5", x2: "46.79", y2: "-2.5", transform: "matrix(0.181746 -0.947707 -1.01992 -0.168086 34.7046 107.134)", stroke: "black", strokeWidth: "5" }), /* @__PURE__ */ import_react100.default.createElement("defs", null, /* @__PURE__ */ import_react100.default.createElement("filter", { id: "filter0_d", x: "39.718", y: "12.3701", width: "73.6225", height: "111.741", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react100.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react100.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react100.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react100.default.createElement("filter", { id: "filter1_d", x: "60.907", y: "97.7083", width: "34.1116", height: "14.2876", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react100.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react100.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react100.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react100.default.createElement("filter", { id: "filter2_d", x: "61.8538", y: "86.2905", width: "34.6506", height: "14.6378", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react100.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react100.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react100.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react100.default.createElement("filter", { id: "filter3_d", x: "61.1752", y: "75.0439", width: "34.6506", height: "14.6378", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react100.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react100.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react100.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react100.default.createElement("filter", { id: "filter4_d", x: "60.901", y: "63.908", width: "34.6506", height: "14.6378", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react100.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react100.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react100.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react100.default.createElement("filter", { id: "filter5_d", x: "78.9333", y: "60.6208", width: "11.0653", height: "56.3113", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react100.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react100.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react100.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react100.default.createElement("filter", { id: "filter6_d", x: "68.0415", y: "62.1831", width: "10.4479", height: "55.716", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react100.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react100.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react100.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react100.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react100.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react100.default.createElement("linearGradient", { id: "paint0_linear", x1: "25.393", y1: "64.5732", x2: "215.189", y2: "46.963", gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ import_react100.default.createElement("stop", { stopColor: "#D17485" }), /* @__PURE__ */ import_react100.default.createElement("stop", { offset: "1", stopColor: "white", stopOpacity: "0" }))));
  };
  var PinkMitoFolk_default = PinkMitoFolk;

  // src/components/icons/mitofolks/YellowMitoFolk.tsx
  var import_react101 = __toESM(require_react());
  var YellowMitoFolk = () => {
    return /* @__PURE__ */ import_react101.default.createElement("svg", { style: { "margin": "75px 50px" }, width: "200", height: "200", viewBox: "0 0 105 133", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react101.default.createElement("line", { y1: "-2.5", x2: "47.2325", y2: "-2.5", transform: "matrix(-0.275217 0.961382 -0.963013 -0.269454 27.7317 82.8152)", stroke: "black", strokeWidth: "5" }), /* @__PURE__ */ import_react101.default.createElement("path", { d: "M65.2668 85.4294L72.7953 132.508", stroke: "black", strokeWidth: "5" }), /* @__PURE__ */ import_react101.default.createElement("line", { y1: "-2", x2: "17.4186", y2: "-2", transform: "matrix(0.447771 0.889458 -0.901022 0.443341 17.3323 33.123)", stroke: "black", strokeWidth: "4" }), /* @__PURE__ */ import_react101.default.createElement("path", { d: "M26.9936 83.7798C25.4254 81.526 24.2862 78.4488 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C65.4373 12.3872 67.9311 13.7984 69.8536 15.8097C67.0517 14.2661 63.9247 13.2415 60.7165 12.7034C54.2889 11.6254 47.5057 12.4949 42.301 15.0867C37.1183 17.6675 33.4759 21.9734 33.3658 27.7745C30.6005 31.137 28.3333 35.9718 26.6505 41.4574C24.9553 46.9833 23.8481 53.1861 23.4254 59.2446C23.0027 65.3021 23.2638 71.2247 24.3113 76.1883C24.9241 79.0922 25.809 81.6819 26.9936 83.7798ZM29.3916 86.2218C27.2356 83.9806 25.7198 80.428 24.8034 76.0857C23.7678 71.1782 23.5065 65.3032 23.9269 59.2777C24.3472 53.2532 25.4484 47.0877 27.1316 41.6009C28.8158 36.1107 31.0778 31.3166 33.81 28.0218L33.866 27.9543L33.8672 27.867C33.9391 22.259 37.4335 18.0668 42.5263 15.5307C47.623 12.9927 54.2955 12.131 60.6314 13.1936C64.2807 13.8057 67.8085 15.0543 70.8547 16.9803C72.0807 18.5872 72.9856 20.5071 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9913C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.5979 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.1908 91.5285 39.6704 91.4856 29.3916 86.2218ZM52.7019 90.8343C44.5671 92.2087 36.1804 91.4087 30.8271 87.4633C40.9137 91.9819 52.8249 91.6283 61.364 83.6145L61.3754 83.6038L61.3854 83.5918C65.3495 78.8115 66.5336 73.3615 66.8414 67.3712C66.9835 64.6049 66.939 61.7156 66.8929 58.7215C66.8891 58.476 66.8853 58.2298 66.8816 57.9829C66.833 54.7406 66.7999 51.3747 67.0107 47.8897C73.571 37.1225 75.2849 28.7521 73.9624 22.643C73.5645 20.8053 72.893 19.1769 72.0003 17.7535C73.7735 19.0302 75.3517 20.5593 76.6538 22.3498C80.3662 27.4544 81.8631 34.7227 79.1866 44.4238C78.2549 47.1052 77.9251 50.122 77.822 53.2776C77.7584 55.2255 77.7813 57.2417 77.8043 59.2693C77.8186 60.5222 77.8328 61.7795 77.8268 63.0277C77.7949 69.5968 77.2007 75.989 73.1861 80.8301C69.1638 85.6806 61.1166 89.4127 52.7019 90.8343Z", fill: "#00090F" }), /* @__PURE__ */ import_react101.default.createElement("path", { d: "M26.9936 83.7798C25.4254 81.526 24.2862 78.4488 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C65.4373 12.3872 67.9311 13.7984 69.8536 15.8097C67.0517 14.2661 63.9247 13.2415 60.7165 12.7034C54.2889 11.6254 47.5057 12.4949 42.301 15.0867C37.1183 17.6675 33.4759 21.9734 33.3658 27.7745C30.6005 31.137 28.3333 35.9718 26.6505 41.4574C24.9553 46.9833 23.8481 53.1861 23.4254 59.2446C23.0027 65.3021 23.2638 71.2247 24.3113 76.1883C24.9241 79.0922 25.809 81.6819 26.9936 83.7798ZM29.3916 86.2218C27.2356 83.9806 25.7198 80.428 24.8034 76.0857C23.7678 71.1782 23.5065 65.3032 23.9269 59.2777C24.3472 53.2532 25.4484 47.0877 27.1316 41.6009C28.8158 36.1107 31.0778 31.3166 33.81 28.0218L33.866 27.9543L33.8672 27.867C33.9391 22.259 37.4335 18.0668 42.5263 15.5307C47.623 12.9927 54.2955 12.131 60.6314 13.1936C64.2807 13.8057 67.8085 15.0543 70.8547 16.9803C72.0807 18.5872 72.9856 20.5071 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9913C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.5979 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.1908 91.5285 39.6704 91.4856 29.3916 86.2218ZM52.7019 90.8343C44.5671 92.2087 36.1804 91.4087 30.8271 87.4633C40.9137 91.9819 52.8249 91.6283 61.364 83.6145L61.3754 83.6038L61.3854 83.5918C65.3495 78.8115 66.5336 73.3615 66.8414 67.3712C66.9835 64.6049 66.939 61.7156 66.8929 58.7215C66.8891 58.476 66.8853 58.2298 66.8816 57.9829C66.833 54.7406 66.7999 51.3747 67.0107 47.8897C73.571 37.1225 75.2849 28.7521 73.9624 22.643C73.5645 20.8053 72.893 19.1769 72.0003 17.7535C73.7735 19.0302 75.3517 20.5593 76.6538 22.3498C80.3662 27.4544 81.8631 34.7227 79.1866 44.4238C78.2549 47.1052 77.9251 50.122 77.822 53.2776C77.7584 55.2255 77.7813 57.2417 77.8043 59.2693C77.8186 60.5222 77.8328 61.7795 77.8268 63.0277C77.7949 69.5968 77.2007 75.989 73.1861 80.8301C69.1638 85.6806 61.1166 89.4127 52.7019 90.8343Z", fill: "url(#paint0_linear)" }), /* @__PURE__ */ import_react101.default.createElement("path", { d: "M26.9936 83.7798C25.4254 81.526 24.2862 78.4488 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C65.4373 12.3872 67.9311 13.7984 69.8536 15.8097C67.0517 14.2661 63.9247 13.2415 60.7165 12.7034C54.2889 11.6254 47.5057 12.4949 42.301 15.0867C37.1183 17.6675 33.4759 21.9734 33.3658 27.7745C30.6005 31.137 28.3333 35.9718 26.6505 41.4574C24.9553 46.9833 23.8481 53.1861 23.4254 59.2446C23.0027 65.3021 23.2638 71.2247 24.3113 76.1883C24.9241 79.0922 25.809 81.6819 26.9936 83.7798ZM29.3916 86.2218C27.2356 83.9806 25.7198 80.428 24.8034 76.0857C23.7678 71.1782 23.5065 65.3032 23.9269 59.2777C24.3472 53.2532 25.4484 47.0877 27.1316 41.6009C28.8158 36.1107 31.0778 31.3166 33.81 28.0218L33.866 27.9543L33.8672 27.867C33.9391 22.259 37.4335 18.0668 42.5263 15.5307C47.623 12.9927 54.2955 12.131 60.6314 13.1936C64.2807 13.8057 67.8085 15.0543 70.8547 16.9803C72.0807 18.5872 72.9856 20.5071 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9913C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.5979 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.1908 91.5285 39.6704 91.4856 29.3916 86.2218ZM52.7019 90.8343C44.5671 92.2087 36.1804 91.4087 30.8271 87.4633C40.9137 91.9819 52.8249 91.6283 61.364 83.6145L61.3754 83.6038L61.3854 83.5918C65.3495 78.8115 66.5336 73.3615 66.8414 67.3712C66.9835 64.6049 66.939 61.7156 66.8929 58.7215C66.8891 58.476 66.8853 58.2298 66.8816 57.9829C66.833 54.7406 66.7999 51.3747 67.0107 47.8897C73.571 37.1225 75.2849 28.7521 73.9624 22.643C73.5645 20.8053 72.893 19.1769 72.0003 17.7535C73.7735 19.0302 75.3517 20.5593 76.6538 22.3498C80.3662 27.4544 81.8631 34.7227 79.1866 44.4238C78.2549 47.1052 77.9251 50.122 77.822 53.2776C77.7584 55.2255 77.7813 57.2417 77.8043 59.2693C77.8186 60.5222 77.8328 61.7795 77.8268 63.0277C77.7949 69.5968 77.2007 75.989 73.1861 80.8301C69.1638 85.6806 61.1166 89.4127 52.7019 90.8343Z", stroke: "black", strokeWidth: "0.5" }), /* @__PURE__ */ import_react101.default.createElement("g", { filter: "url(#filter0_d)" }, /* @__PURE__ */ import_react101.default.createElement("path", { d: "M66.7635 47.8141C65.9014 61.8826 69.0213 73.9921 61.1912 83.4343C52.1711 91.8995 39.3291 91.7402 28.9132 86.2544C17.9362 77.3573 21.5704 38.8254 32.1802 26.0312C41.1979 0.81291 93.0476 4.74773 66.7635 47.8141Z", fill: "#FFDAAE" }), /* @__PURE__ */ import_react101.default.createElement("path", { d: "M66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9914C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.598 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.094 91.6193 39.395 91.4836 29.0537 86.0465C26.3875 83.8735 24.5781 79.8737 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C67.9675 13.14 72.1875 16.8205 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686Z", stroke: "#0A0A0A", strokeWidth: "0.5" })), /* @__PURE__ */ import_react101.default.createElement("g", { filter: "url(#filter1_d)" }, /* @__PURE__ */ import_react101.default.createElement("line", { y1: "-0.125", x2: "19.8557", y2: "-0.125", transform: "matrix(0.99225 -0.137652 0.173912 0.982961 33.1741 78.5916)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ import_react101.default.createElement("g", { filter: "url(#filter2_d)" }, /* @__PURE__ */ import_react101.default.createElement("line", { y1: "-0.125", x2: "20.3124", y2: "-0.125", transform: "matrix(0.991024 -0.146111 0.182398 0.98144 33.1637 69.7397)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ import_react101.default.createElement("g", { filter: "url(#filter3_d)" }, /* @__PURE__ */ import_react101.default.createElement("line", { y1: "-0.125", x2: "20.3124", y2: "-0.125", transform: "matrix(0.991024 -0.146111 0.182398 0.98144 34.7578 60.917)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ import_react101.default.createElement("g", { filter: "url(#filter4_d)" }, /* @__PURE__ */ import_react101.default.createElement("line", { y1: "-0.125", x2: "20.3124", y2: "-0.125", transform: "matrix(0.991024 -0.146112 0.182397 0.98144 36.0442 52.1494)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ import_react101.default.createElement("g", { filter: "url(#filter5_d)" }, /* @__PURE__ */ import_react101.default.createElement("line", { y1: "-0.125", x2: "38.568", y2: "-0.125", transform: "matrix(0.175504 -0.982432 0.981683 0.200291 36.5092 82.8962)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ import_react101.default.createElement("g", { filter: "url(#filter6_d)" }, /* @__PURE__ */ import_react101.default.createElement("line", { y1: "-0.125", x2: "38.067", y2: "-0.125", transform: "matrix(0.164387 -0.984346 0.983775 0.189794 44.8636 84.5642)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ import_react101.default.createElement("path", { d: "M49.2138 20.1738C46.9644 19.7261 45.7307 20.8571 44.8722 21.7876C45.407 22.4447 46.8621 23.8357 48.4045 24.1427C49.9469 24.4497 52.1011 24.0525 52.9056 23.3866C52.5057 22.068 51.3336 20.5957 49.2138 20.1738Z", stroke: "black" }), /* @__PURE__ */ import_react101.default.createElement("mask", { id: "path-14-inside-1", fill: "white" }, /* @__PURE__ */ import_react101.default.createElement("ellipse", { rx: "1.01839", ry: "1.01835", transform: "matrix(0.986125 0.196328 -0.198641 0.974457 47.6494 21.8588)" })), /* @__PURE__ */ import_react101.default.createElement("path", { d: "M47.1744 21.7642C47.2273 21.505 47.4828 21.3372 47.7451 21.3894L47.1491 24.3128C48.5207 24.5859 49.8565 23.7086 50.1328 22.3532L47.1744 21.7642ZM47.7451 21.3894C48.0073 21.4417 48.1772 21.6941 48.1243 21.9533L45.1659 21.3644C44.8896 22.7197 45.7776 24.0398 47.1491 24.3128L47.7451 21.3894ZM48.1243 21.9533C48.0715 22.2126 47.816 22.3803 47.5537 22.3281L48.1496 19.4048C46.7781 19.1317 45.4422 20.009 45.1659 21.3644L48.1243 21.9533ZM47.5537 22.3281C47.2915 22.2759 47.1216 22.0235 47.1744 21.7642L50.1328 22.3532C50.4091 20.9978 49.5212 19.6778 48.1496 19.4048L47.5537 22.3281Z", fill: "black", mask: "url(#path-14-inside-1)" }), /* @__PURE__ */ import_react101.default.createElement("path", { d: "M62.2857 21.3483C60.0364 20.9006 58.8026 22.0317 57.9441 22.9622C58.4789 23.6193 59.9341 25.0103 61.4765 25.3173C63.0189 25.6243 65.1731 25.2271 65.9776 24.5612C65.5777 23.2426 64.4056 21.7703 62.2857 21.3483Z", stroke: "black" }), /* @__PURE__ */ import_react101.default.createElement("mask", { id: "path-17-inside-2", fill: "white" }, /* @__PURE__ */ import_react101.default.createElement("ellipse", { rx: "1.01839", ry: "1.01835", transform: "matrix(0.986125 0.196328 -0.198641 0.974457 60.7213 23.0333)" })), /* @__PURE__ */ import_react101.default.createElement("path", { d: "M60.2464 22.9388C60.2993 22.6795 60.5548 22.5118 60.817 22.564L60.2211 25.4874C61.5926 25.7604 62.9285 24.8831 63.2048 23.5278L60.2464 22.9388ZM60.817 22.564C61.0793 22.6162 61.2491 22.8686 61.1963 23.1279L58.2379 22.5389C57.9616 23.8943 58.8496 25.2143 60.2211 25.4874L60.817 22.564ZM61.1963 23.1279C61.1434 23.3872 60.8879 23.5549 60.6257 23.5027L61.2216 20.5793C59.8501 20.3063 58.5142 21.1835 58.2379 22.5389L61.1963 23.1279ZM60.6257 23.5027C60.3634 23.4505 60.1936 23.198 60.2464 22.9388L63.2048 23.5278C63.4811 22.1724 62.5931 20.8524 61.2216 20.5793L60.6257 23.5027Z", fill: "black", mask: "url(#path-17-inside-2)" }), /* @__PURE__ */ import_react101.default.createElement("path", { d: "M55.1993 24.8215L51.5208 27.443L50.8515 30.2006", stroke: "black" }), /* @__PURE__ */ import_react101.default.createElement("ellipse", { rx: "3.30062", ry: "3.81835", transform: "matrix(0.971768 0.25679 -0.259902 0.960306 49.3348 36.0427)", fill: "#0B0B0B" }), /* @__PURE__ */ import_react101.default.createElement("line", { y1: "-2", x2: "22.0374", y2: "-2", transform: "matrix(-0.865141 0.508647 -0.513608 -0.853839 90.1277 43.4041)", stroke: "black", strokeWidth: "4" }), /* @__PURE__ */ import_react101.default.createElement("line", { y1: "-2", x2: "37.4541", y2: "-2", transform: "matrix(-0.786693 -0.617627 0.626127 -0.779496 90.7851 44.7039)", stroke: "black", strokeWidth: "4" }), /* @__PURE__ */ import_react101.default.createElement("line", { y1: "-2", x2: "24.946", y2: "-2", transform: "matrix(0.861194 -0.515172 0.263521 0.959152 18.4058 34.8635)", stroke: "black", strokeWidth: "4" }), /* @__PURE__ */ import_react101.default.createElement("defs", null, /* @__PURE__ */ import_react101.default.createElement("filter", { id: "filter0_d", x: "18.2485", y: "10.3994", width: "59.8773", height: "87.7246", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react101.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react101.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react101.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react101.default.createElement("filter", { id: "filter1_d", x: "29.1307", y: "75.6125", width: "27.7453", height: "10.9789", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react101.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react101.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react101.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react101.default.createElement("filter", { id: "filter2_d", x: "29.1181", y: "66.5266", width: "28.1757", height: "11.2132", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react101.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react101.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react101.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react101.default.createElement("filter", { id: "filter3_d", x: "30.7122", y: "57.7039", width: "28.1757", height: "11.2132", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react101.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react101.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react101.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react101.default.createElement("filter", { id: "filter4_d", x: "31.9986", y: "48.9363", width: "28.1757", height: "11.2133", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react101.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react101.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react101.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react101.default.createElement("filter", { id: "filter5_d", x: "32.2638", y: "44.9558", width: "15.0143", height: "45.9405", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react101.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react101.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react101.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react101.default.createElement("filter", { id: "filter6_d", x: "40.6176", y: "47.0457", width: "14.5037", height: "45.5186", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react101.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react101.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react101.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react101.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react101.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react101.default.createElement("linearGradient", { id: "paint0_linear", x1: "-22.3171", y1: "36.4033", x2: "105.851", y2: "59.8025", gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ import_react101.default.createElement("stop", { stopColor: "#8A2E28" }), /* @__PURE__ */ import_react101.default.createElement("stop", { offset: "1", stopColor: "white", stopOpacity: "0" }))));
  };
  var YellowMitoFolk_default = YellowMitoFolk;

  // src/utils/pro.tsx
  var unsafeDoNotUseElsewhereHash = (str) => {
    let hash = 0;
    for (let i = 0; i < str.length; i++) {
      const char = str.charCodeAt(i);
      hash = (hash << 5) - hash + char;
      hash = hash & hash;
    }
    return hash;
  };
  var checkProAccessCode = (accessCode) => {
    return unsafeDoNotUseElsewhereHash(accessCode) == 1979576830;
  };

  // src/components/elements/Experiment.tsx
  var import_react102 = __toESM(require_react());

  // src/utils/experiments.tsx
  var isExperimentActive = (analysisData2, experimentID) => {
    var _a;
    return ((_a = analysisData2.experiment) == null ? void 0 : _a.experiment_id) === experimentID;
  };
  var isVariantA = (analysisData2) => {
    var _a;
    return ((_a = analysisData2.experiment) == null ? void 0 : _a.variant) === "A";
  };

  // src/components/elements/Experiment.tsx
  var Experiment = (props) => {
    if (!isExperimentActive(props.analysisData, props.experimentID)) {
      return /* @__PURE__ */ import_react102.default.createElement(import_react102.default.Fragment, null, props.aElement);
    } else {
      if (isVariantA(props.analysisData)) {
        return /* @__PURE__ */ import_react102.default.createElement(import_react102.default.Fragment, null, props.aElement);
      } else {
        return /* @__PURE__ */ import_react102.default.createElement(import_react102.default.Fragment, null, props.bElement);
      }
    }
  };
  var Experiment_default = Experiment;

  // src/components/modals/SignupModal.tsx
  var FirstQuestion = "Your Company/Organization";
  var FirstPlaceholder = "AppleSoftBook";
  var StepOne = (props) => {
    const onSubmit = async (e) => {
      e.preventDefault();
      await props.mitoAPI.updateSignUp(props.email);
      props.next();
    };
    return /* @__PURE__ */ import_react103.default.createElement("div", { className: "signup-modal-left-column" }, /* @__PURE__ */ import_react103.default.createElement("div", null, /* @__PURE__ */ import_react103.default.createElement("h1", { className: "text-header-1", style: { margin: 0 } }, "Sign Up for Mito"), /* @__PURE__ */ import_react103.default.createElement("p", { className: "signup-modal-text" }, "We\u2019ll send you periodic product updates and welcome any feedback. And no spam. Duh.")), /* @__PURE__ */ import_react103.default.createElement("form", { className: "signup-modal-email-form", onSubmit }, /* @__PURE__ */ import_react103.default.createElement("h3", { className: "text-header-2", style: { marginBottom: 0 } }, "Your Email"), /* @__PURE__ */ import_react103.default.createElement(
      Input_default,
      {
        value: props.email,
        onChange: (event) => {
          props.setEmail(event.target.value);
        },
        type: "email",
        width: "large",
        placeholder: "example@gmail.com",
        required: true,
        autoFocus: true
      }
    ), /* @__PURE__ */ import_react103.default.createElement("label", null, /* @__PURE__ */ import_react103.default.createElement("h3", { className: "text-header-2", style: { marginTop: "10px", marginBottom: 0 } }, FirstQuestion)), /* @__PURE__ */ import_react103.default.createElement(
      Input_default,
      {
        value: props.firstResponse,
        onChange: (e) => {
          props.setFirstResponse(e.target.value);
        },
        placeholder: FirstPlaceholder,
        required: true
      }
    ), /* @__PURE__ */ import_react103.default.createElement("div", { className: "mt-10px", style: { marginTop: "10px" } }, /* @__PURE__ */ import_react103.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "large",
        type: "submit"
      },
      "Sign Up"
    ))));
  };
  var StepTwo = (props) => {
    const [isPro, setIsPro] = (0, import_react103.useState)(props.isPro);
    const [enteringProAccessCode, setEnteringProAccessCode] = (0, import_react103.useState)(false);
    const [accessCode, setAccessCode] = (0, import_react103.useState)("");
    const [invalidAccessCode, setInvalidAccessCode] = (0, import_react103.useState)(false);
    const attemptSubmitAccessCode = () => {
      if (!checkProAccessCode(accessCode)) {
        setInvalidAccessCode(true);
        return;
      }
      setInvalidAccessCode(false);
      setEnteringProAccessCode(false);
      setIsPro(true);
      void props.mitoAPI.log("signup_completed_pro", { "location": "signup" });
      void props.mitoAPI.updateGoPro();
      props.next();
    };
    return /* @__PURE__ */ import_react103.default.createElement(import_react103.default.Fragment, null, !enteringProAccessCode && /* @__PURE__ */ import_react103.default.createElement("div", { className: "signup-modal-left-column" }, /* @__PURE__ */ import_react103.default.createElement("div", null, /* @__PURE__ */ import_react103.default.createElement("h1", { className: "text-header-1", style: { marginTop: 0, marginBottom: 0 } }, isPro ? "You've Signed up for Mito Pro!" : "Want More Power? Consider Mito Pro"), /* @__PURE__ */ import_react103.default.createElement("p", { className: "signup-modal-text", style: { marginTop: "10px" } }, isPro ? "Thanks for being a Mito Pro user! Paying for Mito gets you access to advanced functionality and turns off telemetry. In turn, it allows us to fund Mito's development." : "Mito Pro gives you access to advanced functionality, and allows you to turn off telemetry. It also allows us to continue to fund Mito's development!")), !isPro && /* @__PURE__ */ import_react103.default.createElement("div", { className: "signup-modal-buttons", style: { marginTop: "10px" } }, /* @__PURE__ */ import_react103.default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "small",
        onClick: props.back
      },
      "Back"
    ), /* @__PURE__ */ import_react103.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "small",
        href: "https://trymito.io/plans",
        target: "_blank",
        onClick: () => {
          setEnteringProAccessCode(true);
          void props.mitoAPI.log("signup_clicked_pro");
        }
      },
      "See Plans"
    ), /* @__PURE__ */ import_react103.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "small",
        onClick: props.next,
        autoFocus: true
      },
      /* @__PURE__ */ import_react103.default.createElement(Experiment_default, { analysisData: props.analysisData, experimentID: "title_name", aElement: "No Thanks", bElement: "Skip" })
    )), isPro && /* @__PURE__ */ import_react103.default.createElement("div", { className: "signup-modal-buttons", style: { marginTop: "10px" } }, /* @__PURE__ */ import_react103.default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "small",
        onClick: props.back
      },
      "Back"
    ), /* @__PURE__ */ import_react103.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "small",
        onClick: props.next,
        autoFocus: true
      },
      "Continue"
    ))), enteringProAccessCode && /* @__PURE__ */ import_react103.default.createElement("div", { className: "signup-modal-left-column" }, /* @__PURE__ */ import_react103.default.createElement("div", null, /* @__PURE__ */ import_react103.default.createElement("h1", { className: "text-header-1", style: { marginTop: 0, marginBottom: 0 } }, "Access Pro"), /* @__PURE__ */ import_react103.default.createElement("p", { className: "signup-modal-text" }, "Complete the checkout flow. In the Pro documentation, click ", /* @__PURE__ */ import_react103.default.createElement("b", null, "Get Access Code"), " and enter it here."), /* @__PURE__ */ import_react103.default.createElement("label", null, /* @__PURE__ */ import_react103.default.createElement("h3", { className: "text-header-2", style: { marginTop: "5px", marginBottom: 0 } }, "Access Code:")), /* @__PURE__ */ import_react103.default.createElement(
      Input_default,
      {
        placeholder: "mito-pro-access-code-XXXXXXXXXXXX",
        value: accessCode,
        onChange: (e) => {
          setAccessCode(e.target.value);
        },
        onKeyDown: (e) => {
          if (e.key === "Enter") {
            attemptSubmitAccessCode();
          }
        }
      }
    ), invalidAccessCode && /* @__PURE__ */ import_react103.default.createElement("p", { className: "signup-modal-text signup-modal-text-error" }, "Invalid access code")), /* @__PURE__ */ import_react103.default.createElement("div", { className: "signup-modal-buttons", style: { marginTop: "10px" } }, /* @__PURE__ */ import_react103.default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "small",
        onClick: () => {
          setEnteringProAccessCode(false);
        }
      },
      "Back"
    ), /* @__PURE__ */ import_react103.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "small",
        onClick: attemptSubmitAccessCode,
        autoFocus: true
      },
      "Submit"
    ))));
  };
  var StepThree = (props) => {
    const onSubmit = async () => {
      await props.mitoAPI.updateFeedback("company/organization" /* COMPANY */, props.numUsages, [{ "question": FirstQuestion, "answer": props.firstResponse }]);
      props.next();
    };
    return /* @__PURE__ */ import_react103.default.createElement("div", { className: "signup-modal-left-column" }, /* @__PURE__ */ import_react103.default.createElement("div", null, /* @__PURE__ */ import_react103.default.createElement("h1", { className: "text-header-1", style: { marginTop: 0, marginBottom: 0 } }, props.isPro && `Mito Pro is Totally Private`, !props.isPro && `Mito is Built for Privacy`), /* @__PURE__ */ import_react103.default.createElement("p", { className: "signup-modal-text", style: { marginTop: "10px" } }, props.isPro && `As a Mito Pro user, no data leaves your computer, ever. Check out our CCPA compliant privacy policy`, !props.isPro && `We make sure none of your private data leaves your computer. Read our CCPA compliant privacy policy`, " ", " ", /* @__PURE__ */ import_react103.default.createElement("a", { href: "https://privacy.trymito.io/privacy-policy", target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ import_react103.default.createElement("u", null, "here")), ".")), /* @__PURE__ */ import_react103.default.createElement("div", { className: "signup-modal-buttons", style: { marginTop: "10px" } }, /* @__PURE__ */ import_react103.default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "small",
        onClick: props.back
      },
      "Back"
    ), /* @__PURE__ */ import_react103.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "small",
        onClick: onSubmit,
        autoFocus: true
      },
      "Accept"
    )));
  };
  var SignupModal = (props) => {
    const [step, setStep] = (0, import_react103.useState)(1);
    const [email, setEmail] = (0, import_react103.useState)("");
    const [firstResponse, setFirstResponse] = (0, import_react103.useState)("");
    const next = () => {
      if (step + 1 > 3) {
        props.setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenModal: { type: "None" /* None */ },
            currOpenTaskpanel: { type: "import files" /* IMPORT_FILES */ }
          });
        });
        void props.mitoAPI.log("finished_signup");
      } else {
        const newStep = Math.min(step + 1, 3);
        setStep(newStep);
        void props.mitoAPI.log(
          "switched_signup_step",
          {
            "old_signup_step": step,
            "new_signup_step": newStep
          }
        );
      }
    };
    const back = () => {
      const newStep = Math.max(step - 1, 0);
      setStep(newStep);
      void props.mitoAPI.log(
        "switched_signup_step",
        {
          "old_signup_step": step,
          "new_signup_step": newStep
        }
      );
    };
    const backgroundColors = {
      1: "#FFEBEB",
      2: "#F0C5BB",
      3: "#FFDAAE"
    };
    return /* @__PURE__ */ import_react103.default.createElement("div", { className: "overlay" }, /* @__PURE__ */ import_react103.default.createElement("div", { className: "signup-modal-container" }, /* @__PURE__ */ import_react103.default.createElement("div", { className: "signup-modal-left-column-container" }, step === 1 && /* @__PURE__ */ import_react103.default.createElement(
      StepOne,
      {
        next,
        email,
        setEmail,
        firstResponse,
        setFirstResponse,
        mitoAPI: props.mitoAPI
      }
    ), step === 2 && /* @__PURE__ */ import_react103.default.createElement(
      StepTwo,
      {
        next,
        back,
        isPro: props.isPro,
        mitoAPI: props.mitoAPI,
        analysisData: props.analysisData
      }
    ), step === 3 && /* @__PURE__ */ import_react103.default.createElement(
      StepThree,
      {
        next,
        back,
        firstResponse,
        setFirstResponse,
        numUsages: props.numUsages,
        mitoAPI: props.mitoAPI,
        isPro: props.isPro
      }
    )), /* @__PURE__ */ import_react103.default.createElement("div", { className: "signup-modal-right-column-container", style: { backgroundColor: backgroundColors[step] } }, step === 1 && /* @__PURE__ */ import_react103.default.createElement(PinkMitoFolk_default, null), step === 2 && /* @__PURE__ */ import_react103.default.createElement(BlueMitoFolk_default, null), step === 3 && /* @__PURE__ */ import_react103.default.createElement(YellowMitoFolk_default, null))));
  };
  var SignupModal_default = SignupModal;

  // src/components/modals/UpgradeModal.tsx
  var import_react104 = __toESM(require_react());
  var UpgradeModal = (props) => {
    (0, import_react104.useEffect)(() => {
      void props.mitoAPI.log(
        "opened_upgrade_modal"
      );
    }, []);
    const onUpgrade = () => {
      void props.mitoAPI.log(
        "closed_upgrade"
      );
      void props.mitoAPI.updateManuallyMarkUpgraded();
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenModal: { type: "None" /* None */ }
        });
      });
    };
    return /* @__PURE__ */ import_react104.default.createElement("div", { className: "overlay" }, /* @__PURE__ */ import_react104.default.createElement("div", { className: "upgrade-modal-container txt-16" }, /* @__PURE__ */ import_react104.default.createElement("h2", { className: "mt-5px" }, "Time to Upgrade!"), /* @__PURE__ */ import_react104.default.createElement("p", null, "To get Mito's most advanced functionality:"), /* @__PURE__ */ import_react104.default.createElement("ol", null, /* @__PURE__ */ import_react104.default.createElement("li", { className: "mt-5px" }, /* @__PURE__ */ import_react104.default.createElement("p", null, "Open a new terminal/command prompt (where you ran the commands to install Mito).")), /* @__PURE__ */ import_react104.default.createElement("li", { className: "mt-10px" }, /* @__PURE__ */ import_react104.default.createElement("div", { className: "upgrade-modal-code-list-item" }, /* @__PURE__ */ import_react104.default.createElement("p", null, "Run the command:"), /* @__PURE__ */ import_react104.default.createElement("code", { className: "upgrade-modal-code" }, "python -m pip install mitoinstaller --upgrade"))), /* @__PURE__ */ import_react104.default.createElement("li", { className: "mt-10px" }, /* @__PURE__ */ import_react104.default.createElement("div", { className: "upgrade-modal-code-list-item" }, /* @__PURE__ */ import_react104.default.createElement("p", null, "Run the command:"), /* @__PURE__ */ import_react104.default.createElement("code", { className: "upgrade-modal-code" }, "python -m mitoinstaller upgrade"))), /* @__PURE__ */ import_react104.default.createElement("li", { className: "mt-10px" }, /* @__PURE__ */ import_react104.default.createElement("p", null, /* @__PURE__ */ import_react104.default.createElement("b", null, "Restart your Kernel"), " by clicking on Kernel > Restart Kernel.")), /* @__PURE__ */ import_react104.default.createElement("li", { className: "mt-10px" }, /* @__PURE__ */ import_react104.default.createElement("p", null, /* @__PURE__ */ import_react104.default.createElement("b", null, "Refresh this webpage.")))), /* @__PURE__ */ import_react104.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: onUpgrade
      },
      "Got it!"
    )));
  };
  var UpgradeModal_default = UpgradeModal;

  // src/components/taskpanes/Concat/ConcatTaskpane.tsx
  var import_react105 = __toESM(require_react());
  var getColumnHeadersIncludedMessage2 = (notIncludedColumnsArray, arrIndex) => {
    if (notIncludedColumnsArray[arrIndex].length === 0) {
      return /* @__PURE__ */ import_react105.default.createElement("p", null, "\u2713 All columns are included in the concatenated sheet.");
    }
    const [columnHeadersString, numOtherColumnHeaders] = getFirstCharactersOfColumnHeaders(notIncludedColumnsArray[arrIndex], 25);
    if (numOtherColumnHeaders === 0) {
      return /* @__PURE__ */ import_react105.default.createElement("p", null, "Columns ", /* @__PURE__ */ import_react105.default.createElement("span", { className: "text-color-gray-important" }, columnHeadersString), " are not included.");
    } else {
      return /* @__PURE__ */ import_react105.default.createElement("p", null, "Columns ", /* @__PURE__ */ import_react105.default.createElement("span", { className: "text-color-gray-important" }, columnHeadersString), " and ", /* @__PURE__ */ import_react105.default.createElement("span", { className: "text-color-gray-important" }, numOtherColumnHeaders), " others are not included.");
    }
  };
  var ConcatTaskpane = (props) => {
    var _a;
    const { params, setParams } = useLiveUpdatingParams_default(
      {
        join: "inner",
        ignore_index: true,
        sheet_indexes: []
      },
      "concat" /* Concat */,
      props.mitoAPI,
      props.analysisData,
      50
    );
    const [selectableSheetIndexes] = (0, import_react105.useState)(props.sheetDataArray.map((sd, index) => index));
    const concatSheetColumnHeaders = Object.values(((_a = props.sheetDataArray[props.sheetDataArray.length - 1]) == null ? void 0 : _a.columnIDsMap) || {});
    const notIncludedColumnsArray = params == null ? void 0 : params.sheet_indexes.map((sheetIndex) => {
      var _a2;
      return Object.values(((_a2 = props.sheetDataArray[sheetIndex]) == null ? void 0 : _a2.columnIDsMap) || {}).filter((columnHeader) => {
        return !concatSheetColumnHeaders.includes(columnHeader);
      });
    });
    if (params === void 0) {
      return /* @__PURE__ */ import_react105.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState, message: "Import at least two datasets before concating." });
    }
    const dataframeCards = params.sheet_indexes.map((sheetIndex, arrIndex) => {
      return /* @__PURE__ */ import_react105.default.createElement("div", { key: arrIndex }, /* @__PURE__ */ import_react105.default.createElement(
        SelectAndXIconCard_default,
        {
          titleMap: Object.fromEntries(props.sheetDataArray.map((sheetData, index) => {
            return [index + "", sheetData.dfName];
          })),
          value: sheetIndex + "",
          onChange: (newSheetIndexStr) => {
            const newSheetIndex = parseInt(newSheetIndexStr);
            setParams((prevConcatParams) => {
              const newSheetIndexes = [...prevConcatParams.sheet_indexes];
              newSheetIndexes[arrIndex] = newSheetIndex;
              return __spreadProps(__spreadValues({}, prevConcatParams), {
                sheet_indexes: newSheetIndexes
              });
            });
          },
          onDelete: () => {
            setParams((prevConcatParams) => {
              const newSheetIndexes = [...prevConcatParams.sheet_indexes];
              newSheetIndexes.splice(arrIndex, 1);
              return __spreadProps(__spreadValues({}, prevConcatParams), {
                sheet_indexes: newSheetIndexes
              });
            });
          },
          selectableValues: Object.keys(props.sheetDataArray)
        }
      ), notIncludedColumnsArray !== void 0 && /* @__PURE__ */ import_react105.default.createElement(Row_default, { className: "text-subtext-1" }, getColumnHeadersIncludedMessage2(notIncludedColumnsArray, arrIndex)));
    });
    return /* @__PURE__ */ import_react105.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react105.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Concatenate Sheet",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react105.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react105.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react105.default.createElement(Col_default, null, /* @__PURE__ */ import_react105.default.createElement("p", { className: "text-header-3" }, "Join Type")), /* @__PURE__ */ import_react105.default.createElement(Col_default, null, /* @__PURE__ */ import_react105.default.createElement(
      Select_default,
      {
        value: params.join,
        onChange: (newJoin) => {
          setParams((prevConcatParams) => {
            return __spreadProps(__spreadValues({}, prevConcatParams), {
              join: newJoin
            });
          });
        },
        width: "medium"
      },
      /* @__PURE__ */ import_react105.default.createElement(
        DropdownItem_default,
        {
          title: "inner",
          subtext: "Only includes columns that exist in all sheets"
        }
      ),
      /* @__PURE__ */ import_react105.default.createElement(
        DropdownItem_default,
        {
          title: "outer",
          subtext: "Includes all columns from all sheets, regardless of if these columns are in the other sheets."
        }
      )
    ))), /* @__PURE__ */ import_react105.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react105.default.createElement(Col_default, null, /* @__PURE__ */ import_react105.default.createElement(LabelAndTooltip_default, { tooltip: "When on, the resulting dataframe will have indexes 0, 1, 2, etc.. This is useful if you're concatenating objects that don't have meaningful index information." }, "Ignore Existing Indexes")), /* @__PURE__ */ import_react105.default.createElement(Col_default, null, /* @__PURE__ */ import_react105.default.createElement(
      Toggle_default,
      {
        value: params.ignore_index,
        onChange: () => {
          setParams((prevConcatParams) => {
            return __spreadProps(__spreadValues({}, prevConcatParams), {
              ignore_index: !prevConcatParams.ignore_index
            });
          });
        }
      }
    ))), /* @__PURE__ */ import_react105.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react105.default.createElement(Col_default, null, /* @__PURE__ */ import_react105.default.createElement("p", { className: "text-header-3" }, "Dataframes to Concatenate")), /* @__PURE__ */ import_react105.default.createElement(Col_default, null, /* @__PURE__ */ import_react105.default.createElement(
      DropdownButton_default,
      {
        text: "+ Add",
        width: "small",
        searchable: true
      },
      [
        /* @__PURE__ */ import_react105.default.createElement(
          DropdownItem_default,
          {
            key: -1,
            title: "Add all sheets",
            onClick: () => {
              setParams((prevConcatParams) => {
                const newSheetIndexes = [...selectableSheetIndexes];
                return __spreadProps(__spreadValues({}, prevConcatParams), {
                  sheet_indexes: newSheetIndexes
                });
              });
            }
          }
        )
      ].concat(props.sheetDataArray.filter((sheetData, index) => {
        if (!selectableSheetIndexes.includes(index)) {
          return false;
        }
        return true;
      }).map((sheetData, index) => {
        return /* @__PURE__ */ import_react105.default.createElement(
          DropdownItem_default,
          {
            key: index,
            title: sheetData.dfName,
            onClick: () => {
              setParams((prevConcatParams) => {
                const newSheetIndexes = [...prevConcatParams.sheet_indexes];
                newSheetIndexes.push(index);
                return __spreadProps(__spreadValues({}, prevConcatParams), {
                  sheet_indexes: newSheetIndexes
                });
              });
            }
          }
        );
      }))
    ))), dataframeCards));
  };
  var ConcatTaskpane_default = ConcatTaskpane;

  // src/components/taskpanes/DataframeImport/DataframeImportTaskpane.tsx
  var import_react111 = __toESM(require_react());

  // src/hooks/useSendEditOnClick.tsx
  var import_react108 = __toESM(require_react());

  // src/hooks/useEffectOnRedo.tsx
  var import_react106 = __toESM(require_react());
  var useEffectOnRedo = (effect, analysisData2) => {
    (0, import_react106.useEffect)(() => {
      if (analysisData2.redoCount > 0) {
        effect();
      }
    }, [analysisData2.redoCount]);
  };

  // src/hooks/useEffectOnUndo.tsx
  var import_react107 = __toESM(require_react());
  var useEffectOnUndo = (effect, analysisData2) => {
    (0, import_react107.useEffect)(() => {
      if (analysisData2.undoCount > 0) {
        effect();
      }
    }, [analysisData2.undoCount]);
  };

  // src/hooks/useSendEditOnClick.tsx
  function useSendEditOnClick(defaultParams, stepType, mitoAPI, analysisData2, options, onUndoAndRedo) {
    const [params, _setParams] = (0, import_react108.useState)(defaultParams);
    const [error, setError] = (0, import_react108.useState)(void 0);
    const [loading, setLoading] = (0, import_react108.useState)(false);
    const [stepIDData, setStepIDData] = (0, import_react108.useState)({
      stepIDs: [],
      currStepIDIndex: 0
    });
    const [paramsApplied, setParamsApplied] = (0, import_react108.useState)(false);
    const [attemptedEditWithTheseParamsMultipleTimes, setAttemptedEditWithTheseParamsMultipleTimes] = (0, import_react108.useState)(false);
    useEffectOnUndo(() => {
      void refreshOnUndo();
    }, analysisData2);
    useEffectOnRedo(() => {
      void refreshOnRedo();
    }, analysisData2);
    const editEvent = stepType + "_edit";
    const setParams = (0, import_react108.useCallback)(
      (args) => {
        _setParams(args);
        setParamsApplied(false);
        setAttemptedEditWithTheseParamsMultipleTimes(false);
      },
      []
    );
    const edit = async (finalTransform) => {
      if (params === void 0) {
        return;
      } else if (!(options == null ? void 0 : options.allowSameParamsToReapplyTwice) && paramsApplied) {
        setAttemptedEditWithTheseParamsMultipleTimes(true);
        return;
      }
      const finalParams = finalTransform ? finalTransform(params) : params;
      setLoading(true);
      let newStepID = getRandomId();
      if ((options == null ? void 0 : options.overwiteStepIfClickedMultipleTimes) && stepIDData.stepIDs.length > 0) {
        newStepID = stepIDData.stepIDs[stepIDData.stepIDs.length - 1];
      }
      const possibleError = await mitoAPI._edit(editEvent, finalParams, newStepID);
      setLoading(false);
      if (isMitoError(possibleError)) {
        setError(possibleError.to_fix);
      } else {
        setStepIDData((prevStepIDData) => {
          const newStepIDData = { stepIDs: [...prevStepIDData.stepIDs], currStepIDIndex: prevStepIDData.currStepIDIndex };
          newStepIDData.stepIDs.splice(newStepIDData.currStepIDIndex + 1, newStepIDData.stepIDs.length);
          newStepIDData.stepIDs.push(newStepID);
          newStepIDData.currStepIDIndex = newStepIDData.stepIDs.length - 1;
          return newStepIDData;
        });
        setError(void 0);
        setParamsApplied(true);
      }
    };
    const refreshOnUndo = async () => {
      const stepID = stepIDData.stepIDs[stepIDData.currStepIDIndex - 1];
      setStepIDData((prevStepIDData) => {
        const newStepIDData = { stepIDs: [...prevStepIDData.stepIDs], currStepIDIndex: prevStepIDData.currStepIDIndex };
        newStepIDData.currStepIDIndex -= 1;
        return newStepIDData;
      });
      const newParams = await mitoAPI.getParams(stepType, stepID, {});
      if (newParams !== void 0) {
        _setParams(newParams);
        if (onUndoAndRedo !== void 0) {
          onUndoAndRedo(newParams);
        }
      } else {
        _setParams(defaultParams);
        setParamsApplied(false);
        if (onUndoAndRedo !== void 0) {
          onUndoAndRedo(defaultParams());
        }
      }
      setError(void 0);
    };
    const refreshOnRedo = async () => {
      const stepID = stepIDData.stepIDs[stepIDData.currStepIDIndex + 1];
      setStepIDData((prevStepIDData) => {
        const newStepIDData = { stepIDs: [...prevStepIDData.stepIDs], currStepIDIndex: prevStepIDData.currStepIDIndex };
        newStepIDData.currStepIDIndex += 1;
        return newStepIDData;
      });
      const newParams = await mitoAPI.getParams(stepType, stepID, {});
      if (newParams !== void 0) {
        _setParams(newParams);
        if (onUndoAndRedo !== void 0) {
          onUndoAndRedo(newParams);
        }
        setParamsApplied(true);
      }
      setError(void 0);
    };
    let result = void 0;
    if (paramsApplied && analysisData2.stepSummaryList[analysisData2.stepSummaryList.length - 1].step_type === stepType) {
      result = analysisData2.lastResult;
    }
    return {
      params,
      setParams,
      error,
      loading,
      edit,
      editApplied: paramsApplied,
      attemptedEditWithTheseParamsMultipleTimes,
      result
    };
  }
  var useSendEditOnClick_default = useSendEditOnClick;

  // src/components/import/DataframeImportScreen.tsx
  var import_react110 = __toESM(require_react());

  // src/hooks/useStateFromAPIAsync.tsx
  var import_react109 = __toESM(require_react());
  function useStateFromAPIAsync(defaultValue, apiCall, onLoad, params) {
    const [loading, setLoading] = (0, import_react109.useState)(true);
    const [state, setState] = (0, import_react109.useState)(defaultValue);
    (0, import_react109.useEffect)(() => {
      const loadData = async () => {
        setLoading(true);
        const loadedData = await apiCall(...params);
        if (loadedData !== void 0) {
          setState(loadedData);
          if (onLoad !== void 0) {
            const loadedDataCopy = window.structuredClone(loadedData);
            onLoad(loadedDataCopy);
          }
        }
        setLoading(false);
      };
      void loadData();
    }, params);
    return [state, loading];
  }

  // src/components/import/DataframeImportScreen.tsx
  var getButtonMessage = (params) => {
    if (params.df_names.length === 0) {
      return `Select dataframes to import them`;
    }
    return `Import ${params.df_names.length} Selected dataframe${params.df_names.length === 1 ? "" : "s"}`;
  };
  var DataframeImportScreen = (props) => {
    var _a, _b;
    const [dfNamesInNotebook] = useStateFromAPIAsync(
      [],
      () => {
        return props.mitoAPI.getDefinedDfNames();
      },
      void 0,
      []
    );
    const dataframeCards = (((_a = props.params) == null ? void 0 : _a.df_names) || []).map((dfName, arrIndex) => {
      return /* @__PURE__ */ import_react110.default.createElement(
        SelectAndXIconCard_default,
        {
          key: arrIndex,
          value: dfName,
          onChange: (newDfName) => {
            props.setParams((prevParams) => {
              const newDfNames = [...prevParams.df_names];
              newDfNames[arrIndex] = newDfName;
              return __spreadProps(__spreadValues({}, prevParams), {
                df_names: newDfNames
              });
            });
          },
          onDelete: () => {
            props.setParams((prevParams) => {
              const newDfNames = [...prevParams.df_names];
              newDfNames.splice(arrIndex, 1);
              return __spreadProps(__spreadValues({}, prevParams), {
                df_names: newDfNames
              });
            });
          },
          selectableValues: dfNamesInNotebook
        }
      );
    });
    if (props.params === void 0) {
      return /* @__PURE__ */ import_react110.default.createElement("div", { className: "text-body-1" }, "There has been an error loading dataframes to import. Please try again, or contact support.");
    }
    return /* @__PURE__ */ import_react110.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react110.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: props.isUpdate ? "Import Dataframes" : "Update Import",
        setUIState: props.setUIState,
        backCallback: props.backCallback
      }
    ), /* @__PURE__ */ import_react110.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react110.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react110.default.createElement(Col_default, null, /* @__PURE__ */ import_react110.default.createElement(LabelAndTooltip_default, { tooltip: "Dataframes that have been created elsewhere in this notebook can be imported through this taskpane." }, "Dataframes to Import")), /* @__PURE__ */ import_react110.default.createElement(Col_default, null, /* @__PURE__ */ import_react110.default.createElement(
      DropdownButton_default,
      {
        text: "+ Add",
        width: "small",
        searchable: true
      },
      dfNamesInNotebook.map((dfName, index) => {
        return /* @__PURE__ */ import_react110.default.createElement(
          DropdownItem_default,
          {
            key: index,
            title: dfName,
            onClick: () => {
              props.setParams((prevParams) => {
                const newDfNames = [...prevParams.df_names];
                newDfNames.push(dfName);
                return __spreadProps(__spreadValues({}, prevParams), {
                  df_names: newDfNames
                });
              });
            }
          }
        );
      })
    ))), dataframeCards, dataframeCards.length === 0 && /* @__PURE__ */ import_react110.default.createElement(Row_default, null, /* @__PURE__ */ import_react110.default.createElement("p", { className: "text-subtext-1" }, "Import an existing dataframe as a new sheet tab in Mito"))), /* @__PURE__ */ import_react110.default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ import_react110.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          props.edit();
        },
        disabled: (((_b = props.params) == null ? void 0 : _b.df_names.length) || 0) === 0
      },
      getButtonMessage(props.params)
    )));
  };
  var DataframeImportScreen_default = DataframeImportScreen;

  // src/components/taskpanes/DataframeImport/DataframeImportTaskpane.tsx
  var DataframeImportTaskpane = (props) => {
    const { params, setParams, edit } = useSendEditOnClick_default(
      () => {
        return { df_names: [] };
      },
      "dataframe_import" /* DataframeImport */,
      props.mitoAPI,
      props.analysisData,
      { allowSameParamsToReapplyTwice: true }
    );
    return /* @__PURE__ */ import_react111.default.createElement(
      DataframeImportScreen_default,
      {
        mitoAPI: props.mitoAPI,
        analysisData: props.analysisData,
        setUIState: props.setUIState,
        isUpdate: false,
        params,
        setParams,
        edit
      }
    );
  };
  var DataframeImportTaskpane_default = DataframeImportTaskpane;

  // src/components/taskpanes/Download/DownloadTaskpane.tsx
  var import_react116 = __toESM(require_react());

  // src/components/taskpanes/Download/ExcelDownloadConfigSection.tsx
  var import_react114 = __toESM(require_react());

  // src/pro/download/ExcelFormatSection.tsx
  var import_react112 = __toESM(require_react());
  var ExcelFormatSection = (props) => {
    props;
    return /* @__PURE__ */ import_react112.default.createElement(import_react112.default.Fragment, null, "Excel formatting export coming soon!");
  };
  var ExcelFormatSection_default = ExcelFormatSection;

  // src/components/elements/MultiToggleDataframes.tsx
  var import_react113 = __toESM(require_react());
  var MultiToggleDataframes = (props) => {
    const selectedSheetIndexes = [...props.selectedSheetIndexes].sort();
    return /* @__PURE__ */ import_react113.default.createElement(
      MultiToggleBox_default,
      {
        width: "block",
        height: props.height || "small",
        onToggleAll: (newIndexes) => {
          newIndexes.sort();
          props.onChange(newIndexes);
        }
      },
      props.sheetDataArray.map((sheetData, index) => {
        const dfName = sheetData.dfName;
        return /* @__PURE__ */ import_react113.default.createElement(
          MultiToggleItem_default,
          {
            key: index,
            title: dfName,
            toggled: selectedSheetIndexes.includes(index),
            index,
            onToggle: () => {
              const newSheetIndexes = [...selectedSheetIndexes];
              toggleInArray(newSheetIndexes, index);
              newSheetIndexes.sort();
              props.onChange(newSheetIndexes);
            }
          }
        );
      })
    );
  };
  var MultiToggleDataframes_default = MultiToggleDataframes;

  // src/components/taskpanes/Download/ExcelDownloadConfigSection.tsx
  var ExcelDownloadConfigSection = (props) => {
    return /* @__PURE__ */ import_react114.default.createElement(import_react114.default.Fragment, null, /* @__PURE__ */ import_react114.default.createElement("p", { className: "text-header-3" }, "Dataframes to Export"), /* @__PURE__ */ import_react114.default.createElement(
      MultiToggleDataframes_default,
      {
        sheetDataArray: props.sheetDataArray,
        selectedSheetIndexes: props.exportState.sheetIndexes,
        setUIState: props.setUIState,
        onChange: (newSelectedSheetIndexes) => {
          props.setUIState((prevUiState) => {
            return __spreadProps(__spreadValues({}, prevUiState), {
              exportConfiguration: { exportType: "excel", sheetIndexes: newSelectedSheetIndexes }
            });
          });
        }
      }
    ), props.userProfile.isPro && /* @__PURE__ */ import_react114.default.createElement(
      ExcelFormatSection_default,
      {
        dfNames: props.dfNames,
        mitoAPI: props.mitoAPI,
        sheetDataArray: props.sheetDataArray,
        exportState: props.exportState,
        newlyFormattedColumns: props.newlyFormattedColumns,
        setNewlyFormattedColumns: props.setNewlyFormattedColumns
      }
    ), !props.userProfile.isPro && /* @__PURE__ */ import_react114.default.createElement(Row_default, { justify: "space-around" }, /* @__PURE__ */ import_react114.default.createElement("p", { className: "ma-25px text-align-center text-body-1" }, "Want to preserving your formatting when exporting to Excel? Consider upgrading to\xA0", /* @__PURE__ */ import_react114.default.createElement(
      "a",
      {
        onClick: () => void props.mitoAPI.log(
          "clicked_pro_button",
          {
            "pro_button_location": "download_taskpane_excel_format_export"
          }
        ),
        className: "text-body-1-link",
        href: "https://www.trymito.io/plans",
        target: "_blank",
        rel: "noreferrer"
      },
      "Mito Pro"
    ), ".")));
  };
  var ExcelDownloadConfigSection_default = ExcelDownloadConfigSection;

  // src/components/taskpanes/Download/CSVDownloadConfigSection.tsx
  var import_react115 = __toESM(require_react());
  var CSVDownloadConfigSection = (props) => {
    return /* @__PURE__ */ import_react115.default.createElement(import_react115.default.Fragment, null, /* @__PURE__ */ import_react115.default.createElement(
      DataframeSelect_default,
      {
        title: "Dataframe to Export",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: props.selectedSheetIndex,
        onChange: (newSheetIndex) => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              selectedSheetIndex: newSheetIndex,
              exportConfiguration: { exportType: "csv" }
            });
          });
        }
      }
    ), /* @__PURE__ */ import_react115.default.createElement(Row_default, { justify: "space-around" }, /* @__PURE__ */ import_react115.default.createElement("p", { className: "ma-25px text-align-center" }, "CSV exports will not reflect any formatting changes made in Mito.")));
  };
  var CSVDownloadConfigSection_default = CSVDownloadConfigSection;

  // src/components/taskpanes/Download/DownloadTaskpane.tsx
  var DownloadTaskpane = (props) => {
    var _a;
    const [newlyFormattedColumns, setNewlyFormattedColumns] = (0, import_react116.useState)(() => {
      const newlyFormattedColumnsInitial = {};
      props.sheetDataArray.forEach((_, idx) => {
        newlyFormattedColumnsInitial[idx] = [];
      });
      return newlyFormattedColumnsInitial;
    });
    const [exportString, setExportString] = (0, import_react116.useState)("");
    const emptySheet = props.sheetDataArray.length === 0;
    const numRows = (_a = props.sheetDataArray[props.selectedSheetIndex]) == null ? void 0 : _a.numRows;
    const loadExport = async () => {
      if (emptySheet) {
        return;
      }
      if (props.uiState.exportConfiguration.exportType === "csv") {
        const csvString = await props.mitoAPI.getDataframeAsCSV(props.selectedSheetIndex);
        setExportString(csvString);
      } else if (props.uiState.exportConfiguration.exportType === "excel") {
        const excelString = await props.mitoAPI.getDataframesAsExcel(props.uiState.exportConfiguration.sheetIndexes);
        setExportString(excelString);
      }
    };
    useDebouncedEffect(() => {
      setExportString("");
      void loadExport();
    }, [props.uiState.exportConfiguration, props.selectedSheetIndex, props.sheetDataArray], 500);
    const onDownload = () => {
      void props.mitoAPI.log(
        "button_download_log_event",
        {
          sheet_index: props.selectedSheetIndex,
          export_type: props.uiState.exportConfiguration.exportType
        }
      );
    };
    if (emptySheet) {
      return /* @__PURE__ */ import_react116.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    let exportHRef = "";
    let exportName = "";
    if (props.uiState.exportConfiguration.exportType === "csv") {
      exportHRef = URL.createObjectURL(new Blob(
        [exportString],
        { type: "text/csv" }
      ));
      exportName = "MitoExport.csv";
    } else if (props.uiState.exportConfiguration.exportType === "excel") {
      exportHRef = URL.createObjectURL(new Blob(
        [Uint8Array.from(window.atob(exportString), (c) => c.charCodeAt(0))],
        { type: "text/csv" }
      ));
      exportName = "MitoExport.xlsx";
    }
    return /* @__PURE__ */ import_react116.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react116.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Download",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react116.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react116.default.createElement("div", null, /* @__PURE__ */ import_react116.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react116.default.createElement("p", { className: "text-header-3" }, "Export Type"), /* @__PURE__ */ import_react116.default.createElement(
      Select_default,
      {
        width: "medium",
        value: props.uiState.exportConfiguration.exportType,
        onChange: (newExportType) => {
          setExportString("");
          props.setUIState((prevUIState) => {
            if (newExportType === "csv") {
              return __spreadProps(__spreadValues({}, prevUIState), {
                exportConfiguration: { exportType: "csv" }
              });
            } else {
              return __spreadProps(__spreadValues({}, prevUIState), {
                exportConfiguration: { exportType: "excel", sheetIndexes: [props.selectedSheetIndex] }
              });
            }
          });
        }
      },
      /* @__PURE__ */ import_react116.default.createElement(
        DropdownItem_default,
        {
          title: "csv"
        }
      ),
      /* @__PURE__ */ import_react116.default.createElement(
        DropdownItem_default,
        {
          title: "excel",
          subtext: numRows > 1048576 ? `An Excel file holds at most 1,048,576 rows, but there are ${numRows} rows in this dataframe. We'll export the first 1,048,576 rows, but this may take several minutes.` : `Due to Python limitations, Excel export can be slower than CSV export.`
        }
      )
    )), props.uiState.exportConfiguration.exportType === "excel" && /* @__PURE__ */ import_react116.default.createElement(
      ExcelDownloadConfigSection_default,
      {
        dfNames: props.dfNames,
        mitoAPI: props.mitoAPI,
        userProfile: props.userProfile,
        sheetDataArray: props.sheetDataArray,
        exportState: props.uiState.exportConfiguration,
        setUIState: props.setUIState,
        newlyFormattedColumns,
        setNewlyFormattedColumns
      }
    ), props.uiState.exportConfiguration.exportType === "csv" && /* @__PURE__ */ import_react116.default.createElement(
      CSVDownloadConfigSection_default,
      {
        sheetDataArray: props.sheetDataArray,
        mitoAPI: props.mitoAPI,
        selectedSheetIndex: props.selectedSheetIndex,
        setUIState: props.setUIState
      }
    ))), /* @__PURE__ */ import_react116.default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ import_react116.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        disabled: exportString === "",
        href: exportHRef,
        download: exportName,
        onClick: onDownload
      },
      exportString === "" ? /* @__PURE__ */ import_react116.default.createElement(import_react116.default.Fragment, null, "Preparing data for download ", /* @__PURE__ */ import_react116.default.createElement(LoadingDots_default, null)) : `Download ${props.uiState.exportConfiguration.exportType === "csv" ? "CSV file" : "Excel workbook"}`
    )));
  };
  var DownloadTaskpane_default = DownloadTaskpane;

  // src/components/taskpanes/DropDuplicates/DropDuplicates.tsx
  var import_react117 = __toESM(require_react());
  var getDefaultParams3 = (selectedSheetIndex, sheetDataArray2) => {
    var _a;
    if (sheetDataArray2.length === 0) {
      return void 0;
    }
    return {
      sheet_index: selectedSheetIndex,
      column_ids: Object.keys((_a = sheetDataArray2[selectedSheetIndex]) == null ? void 0 : _a.columnIDsMap),
      keep: "first"
    };
  };
  var DropDuplicatesTaskpane = (props) => {
    const { params, setParams, loading, edit, editApplied, attemptedEditWithTheseParamsMultipleTimes, result } = useSendEditOnClick_default(
      () => getDefaultParams3(props.selectedSheetIndex, props.sheetDataArray),
      "drop_duplicates" /* DropDuplicates */,
      props.mitoAPI,
      props.analysisData
    );
    if (props.sheetDataArray.length === 0 || params === void 0) {
      return /* @__PURE__ */ import_react117.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    if (props.sheetDataArray[params.sheet_index] === void 0) {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: { type: "none" /* NONE */ }
        });
      });
      return /* @__PURE__ */ import_react117.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    return /* @__PURE__ */ import_react117.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react117.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Drop Duplicates",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react117.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react117.default.createElement(
      DataframeSelect_default,
      {
        title: "Dataframe to drop duplicates within.",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: params.sheet_index,
        onChange: (newSheetIndex) => {
          setParams((dropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, dropDuplicateParams), {
              sheet_index: newSheetIndex,
              column_ids: props.sheetDataArray[newSheetIndex].data.map((c) => c.columnID)
            });
          });
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              selectedSheetIndex: newSheetIndex
            });
          });
        }
      }
    ), /* @__PURE__ */ import_react117.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react117.default.createElement(Col_default, null, /* @__PURE__ */ import_react117.default.createElement("p", { className: "text-header-3" }, "Duplicates to Keep")), /* @__PURE__ */ import_react117.default.createElement(Col_default, null, /* @__PURE__ */ import_react117.default.createElement(
      Select_default,
      {
        width: "medium",
        value: params.keep + "",
        onChange: (newKeep) => {
          if (newKeep === "false") {
            newKeep = false;
          }
          setParams((dropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, dropDuplicateParams), {
              keep: newKeep
            });
          });
        }
      },
      /* @__PURE__ */ import_react117.default.createElement(
        DropdownItem_default,
        {
          title: "first",
          subtext: "Keep the first instance of the duplicated row."
        }
      ),
      /* @__PURE__ */ import_react117.default.createElement(
        DropdownItem_default,
        {
          title: "last",
          subtext: "Keep the last instance of the duplicated row."
        }
      ),
      /* @__PURE__ */ import_react117.default.createElement(
        DropdownItem_default,
        {
          id: "false",
          title: "none",
          subtext: "Keep none of the duplicated rows."
        }
      )
    ))), /* @__PURE__ */ import_react117.default.createElement("p", { className: "text-header-3 mt-10px" }, "Columns to Deduplicate On"), /* @__PURE__ */ import_react117.default.createElement(
      MultiToggleColumns_default,
      {
        sheetData: props.sheetDataArray[params.sheet_index],
        selectedColumnIDs: params.column_ids,
        onChange: (newSelectedColumnIDs) => {
          setParams((oldDropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, oldDropDuplicateParams), {
              column_ids: newSelectedColumnIDs
            });
          });
        }
      }
    ), /* @__PURE__ */ import_react117.default.createElement(Spacer_default, { px: 25 }), /* @__PURE__ */ import_react117.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => edit(),
        disabled: false
      },
      !loading ? `Drop duplicates in ${params.column_ids.length} columns` : "Dropping duplicates..."
    ), editApplied && !loading && /* @__PURE__ */ import_react117.default.createElement(Row_default, { className: "mt-5" }, /* @__PURE__ */ import_react117.default.createElement("p", { className: "text-subtext-1" }, "Removed ", /* @__PURE__ */ import_react117.default.createElement("span", { className: "text-color-gray-important" }, !attemptedEditWithTheseParamsMultipleTimes ? (result == null ? void 0 : result.num_rows_dropped) || 0 : 0), " rows."))));
  };
  var DropDuplicates_default = DropDuplicatesTaskpane;

  // src/components/taskpanes/FileImport/FileImportTaskpane.tsx
  var import_react134 = __toESM(require_react());

  // src/components/import/FileBrowser/FileBrowser.tsx
  var import_react127 = __toESM(require_react());

  // src/utils/packageVersion.tsx
  var isAtLeastBenchmarkVersion = (currentVersion, benchmarkVersion) => {
    const currentVersionParts = currentVersion.split(".").map((versionPart) => parseInt(versionPart));
    const benchmarkVersionParts = benchmarkVersion.split(".").map((versionPart) => parseInt(versionPart));
    if (currentVersionParts.length == 1) {
      currentVersionParts[1] = 0;
    }
    if (currentVersionParts.length == 2) {
      currentVersionParts[2] = 0;
    }
    for (let i = 0; i < currentVersionParts.length; i++) {
      if (currentVersionParts[i] > benchmarkVersionParts[i]) {
        return true;
      }
      if (currentVersionParts[i] < benchmarkVersionParts[i]) {
        return false;
      }
    }
    return true;
  };
  var isExcelImportEnabled = (userProfile2) => {
    return isAtLeastBenchmarkVersion(userProfile2.pythonVersion, "3.6.0") && isAtLeastBenchmarkVersion(userProfile2.pandasVersion, "0.25.0");
  };

  // src/components/icons/ConfigureIcon.tsx
  var import_react118 = __toESM(require_react());
  var ConfigureIcon = () => {
    return /* @__PURE__ */ import_react118.default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react118.default.createElement("path", { d: "M8.89617 1.82873L7.80328 2.57459L6.92896 2.04972V1H4.96175V2.04972L4.1694 2.57459L3.24044 1.82873L1.81967 3.18232L2.55738 4.09392C2.46135 4.43914 2.31148 5.06077 2.31148 5.06077L1 5.19889V6.96685L2.31148 7.1326L2.55738 8.20994L1.81967 9.14917L3.13115 10.3094L4.1694 9.50829L5.07104 10.0884V11H6.92896V10.0884L7.80328 9.50829L8.89617 10.3094L10.153 9.14917L9.44262 8.20994L9.79781 7.1326L11 6.96685V5.19889L9.79781 4.9779L9.44262 4.09392L10.153 3.18232L8.89617 1.82873Z", stroke: "#9D6CFF" }));
  };
  var ConfigureIcon_default = ConfigureIcon;

  // src/components/taskpanes/FileImport/importUtils.tsx
  var PARENT_FOLDER_NAME = "Parent Folder";
  var getFileEnding = (elementName) => {
    try {
      const nameSplit = elementName.split(".");
      return nameSplit[nameSplit.length - 1];
    } catch (e) {
      return void 0;
    }
  };
  var getInvalidFileError = (selectedElement, excelImportEnabled) => {
    if (selectedElement.isDirectory) {
      return void 0;
    }
    const VALID_FILE_ENDINGS = [
      "csv",
      "tsv",
      "txt",
      "tab"
    ];
    if (excelImportEnabled) {
      VALID_FILE_ENDINGS.push("xlsx");
    }
    for (const ending of VALID_FILE_ENDINGS) {
      if (selectedElement.name.toLowerCase().endsWith(ending)) {
        return void 0;
      }
    }
    const fileEnding = getFileEnding(selectedElement.name);
    if (fileEnding === void 0) {
      return "Sorry, we don't support that file type.";
    } else if (fileEnding == "xlsx") {
      return "Upgrade to pandas>=0.25.0 and Python>3.6 to import Excel files.";
    } else {
      return `Sorry, we don't support ${fileEnding} files.`;
    }
  };
  var getImportButtonStatus = (selectedElement, excelImportEnabled, loadingImport, isUpdate) => {
    if (selectedElement === void 0) {
      return {
        disabled: true,
        buttonText: "Select a File to Import"
      };
    }
    if (selectedElement.isDirectory) {
      return {
        disabled: true,
        buttonText: "That's a Directory. Select a File"
      };
    }
    const invalidFileError = getInvalidFileError(selectedElement, excelImportEnabled);
    if (invalidFileError !== void 0) {
      return {
        disabled: true,
        buttonText: "Select a Supported File Type"
      };
    }
    if (loadingImport) {
      return {
        disabled: false,
        buttonText: "Importing..."
      };
    }
    return {
      disabled: false,
      buttonText: (!isUpdate ? "Import " : "Update to ") + selectedElement.name
    };
  };
  var isExcelFile = (element) => {
    return element !== void 0 && !(element == null ? void 0 : element.isDirectory) && (element == null ? void 0 : element.name.toLowerCase().endsWith(".xlsx"));
  };
  var getElementsToDisplay = (importState) => {
    const allElements = [...importState.pathContents.elements];
    if (!inRootFolder(importState.pathContents.path_parts)) {
      allElements.push({
        isDirectory: true,
        isParentDirectory: true,
        name: PARENT_FOLDER_NAME,
        lastModified: 0
      });
    }
    const searchedElements = allElements.filter((element) => {
      return fuzzyMatch(element.name, importState.searchString) > 0.8;
    });
    return searchedElements.sort((elementOne, elementTwo) => {
      if (elementOne.name === PARENT_FOLDER_NAME) {
        return -1;
      } else if (elementTwo.name === PARENT_FOLDER_NAME) {
        return 1;
      }
      if (importState.sort === "name_ascending") {
        return elementOne.name < elementTwo.name ? -1 : 1;
      } else if (importState.sort === "name_descending") {
        return elementOne.name >= elementTwo.name ? -1 : 1;
      } else if (typeof elementOne.lastModified !== "number" || typeof elementTwo.lastModified !== "number") {
        return 1;
      } else if (importState.sort === "last_modified_ascending") {
        return elementOne.lastModified < elementTwo.lastModified ? -1 : 1;
      } else {
        return elementOne.lastModified >= elementTwo.lastModified ? -1 : 1;
      }
    });
  };
  var inRootFolder = (pathParts) => {
    pathParts = pathParts.filter((pathPart) => pathPart !== "");
    return pathParts.length === 1 && (pathParts[0] === "/" || pathParts[0] === "\\");
  };
  var getFilePath = async (mitoAPI, pathParts, file) => {
    const fullPath = [...pathParts];
    if (file === void 0) {
      return;
    }
    fullPath.push(file == null ? void 0 : file.name);
    return await mitoAPI.getPathJoined(fullPath);
  };

  // src/components/import/FileBrowser/FileBrowserBody.tsx
  var import_react126 = __toESM(require_react());

  // src/components/icons/SortArrowIcon.tsx
  var import_react119 = __toESM(require_react());
  var SortArrowIcon = (props) => {
    if (props.direction === "ascending") {
      return /* @__PURE__ */ import_react119.default.createElement("svg", { width: "8", height: "4", viewBox: "0 0 8 4", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react119.default.createElement("path", { d: "M4.00073 4L0.536631 0.25H7.46483L4.00073 4Z", fill: "#C4C4C4" }));
    } else {
      return /* @__PURE__ */ import_react119.default.createElement("svg", { width: "8", height: "4", viewBox: "0 0 8 4", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react119.default.createElement("path", { d: "M4.00073 0L0.536631 3.75H7.46483L4.00073 0Z", fill: "#C4C4C4" }));
    }
  };
  var SortArrowIcon_default = SortArrowIcon;

  // src/components/import/FileBrowser/FileBrowserElement.tsx
  var import_react123 = __toESM(require_react());

  // src/components/icons/CSVFileIcon.tsx
  var import_react120 = __toESM(require_react());
  var CSVFileIcon = () => {
    return /* @__PURE__ */ import_react120.default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 8 7", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react120.default.createElement("path", { d: "M1 3.75V6C1 6.13807 1.11193 6.25 1.25 6.25H4M1 3.75V1.5C1 1.36193 1.11193 1.25 1.25 1.25H4M1 3.75H7M7 3.75V1.5C7 1.36193 6.88807 1.25 6.75 1.25H4M7 3.75V6C7 6.13807 6.88807 6.25 6.75 6.25H4M4 1.25V6.25", stroke: "#343434", strokeWidth: "0.75", strokeLinecap: "round", strokeLinejoin: "round" }));
  };
  var CSVFileIcon_default = CSVFileIcon;

  // src/components/icons/DirectoryIcon.tsx
  var import_react121 = __toESM(require_react());
  var DirectoryIcon = () => {
    return /* @__PURE__ */ import_react121.default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 8 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react121.default.createElement("path", { d: "M3.86144 1H1.25C1.11193 1 1 1.11193 1 1.25V4.75C1 4.88807 1.11193 5 1.25 5H6.75C6.88807 5 7 4.88807 7 4.75V2.05C7 1.91193 6.88807 1.8 6.75 1.8H4.63856C4.55236 1.8 4.47225 1.75559 4.42656 1.6825L4.07344 1.1175C4.02775 1.0444 3.94764 1 3.86144 1Z", stroke: "#343434", strokeWidth: "0.75", strokeLinecap: "round", strokeLinejoin: "round" }));
  };
  var DirectoryIcon_default = DirectoryIcon;

  // src/components/icons/FileIcon.tsx
  var import_react122 = __toESM(require_react());
  var FileIcon = () => {
    return /* @__PURE__ */ import_react122.default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 8 7", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react122.default.createElement("path", { d: "M1 1.25V5.75C1 5.88807 1.11193 6 1.25 6H6.75C6.88807 6 7 5.88807 7 5.75V2.94244C7 2.89827 6.9883 2.85489 6.96609 2.81671L5.9814 1.12428C5.93663 1.04733 5.85433 1 5.76531 1H1.25C1.11193 1 1 1.11193 1 1.25Z", stroke: "#343434", strokeWidth: "0.75", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ import_react122.default.createElement("path", { d: "M2.63647 2.71875H5.36375", stroke: "#343434", strokeWidth: "0.75", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ import_react122.default.createElement("path", { d: "M2.63647 4.28125H5.36375", stroke: "#343434", strokeWidth: "0.75", strokeLinecap: "round", strokeLinejoin: "round" }));
  };
  var FileIcon_default = FileIcon;

  // src/components/import/FileBrowser/FileBrowserElement.tsx
  function FileBrowserElement(props) {
    const elementRef = (0, import_react123.useRef)(null);
    const isSelected = props.index === props.fileBrowserState.selectedElementIndex;
    (0, import_react123.useEffect)(() => {
      var _a;
      const element = elementRef.current;
      const parent = (_a = elementRef.current) == null ? void 0 : _a.parentElement;
      if (isSelected && element && parent) {
        ensureInView(parent, elementRef.current, 0);
      }
    }, [isSelected]);
    const invalidFileError = getInvalidFileError(props.element, props.excelImportEnabled);
    return /* @__PURE__ */ import_react123.default.createElement(
      "div",
      {
        ref: elementRef,
        className: "file-browser-element p-5px text-unselectable",
        title: props.element.name,
        style: { background: isSelected ? "#D5C0FF" : "" },
        onClick: (e) => {
          if (e.detail > 1) {
            return;
          }
          if (isSelected) {
            props.setFileBrowserState((prevImportState) => {
              return __spreadProps(__spreadValues({}, prevImportState), {
                selectedElementIndex: -1
              });
            });
          } else {
            props.setFileBrowserState((prevImportState) => {
              return __spreadProps(__spreadValues({}, prevImportState), {
                selectedElementIndex: props.index
              });
            });
          }
        },
        onDoubleClick: () => {
          if (props.element.isParentDirectory) {
            const newPathParts = [...props.fileBrowserState.pathContents.path_parts];
            newPathParts.pop();
            props.setCurrPathParts(newPathParts);
          } else if (props.element.isDirectory) {
            const newPathParts = props.fileBrowserState.pathContents.path_parts || [];
            newPathParts.push(props.element.name);
            props.setCurrPathParts(newPathParts);
          } else {
            if (isExcelFile(props.element)) {
              const openExcelImport = async () => {
                const filePath = await getFilePath(props.mitoAPI, props.currPathParts, props.element);
                if (filePath === void 0) {
                  return;
                }
                props.setImportState({
                  screen: "xlsx_import_config",
                  fileName: props.element.name,
                  filePath
                });
              };
              void openExcelImport();
            } else {
              void props.importCSVFile(props.element);
            }
          }
        }
      },
      /* @__PURE__ */ import_react123.default.createElement(Row_default, { suppressTopBottomMargin: true, justify: "space-between" }, /* @__PURE__ */ import_react123.default.createElement(Col_default, { span: 17, offsetRight: 1 }, /* @__PURE__ */ import_react123.default.createElement("div", { className: "flexbox-row" }, /* @__PURE__ */ import_react123.default.createElement("div", { className: "mr-5px mt-2px" }, props.element.isDirectory && props.element.isParentDirectory && /* @__PURE__ */ import_react123.default.createElement(BackArrowIcon_default, { width: "14px" }), props.element.isDirectory && !props.element.isParentDirectory && /* @__PURE__ */ import_react123.default.createElement(DirectoryIcon_default, null), !props.element.isDirectory && invalidFileError === void 0 && /* @__PURE__ */ import_react123.default.createElement(CSVFileIcon_default, null), !props.element.isDirectory && invalidFileError !== void 0 && /* @__PURE__ */ import_react123.default.createElement(FileIcon_default, null)), /* @__PURE__ */ import_react123.default.createElement("div", null, props.element.name))), /* @__PURE__ */ import_react123.default.createElement(Col_default, { span: 6 }, /* @__PURE__ */ import_react123.default.createElement("p", { className: "text-align-right" }, props.element.lastModified !== 0 && getLastModifiedString(props.element.lastModified)))),
      isSelected && invalidFileError !== void 0 && /* @__PURE__ */ import_react123.default.createElement("div", { className: "pl-5px pr-5px" }, /* @__PURE__ */ import_react123.default.createElement("span", null, " ", invalidFileError, " "))
    );
  }
  var FileBrowserElement_default = FileBrowserElement;

  // src/components/import/FileBrowser/FileBrowserPathSelector.tsx
  var import_react125 = __toESM(require_react());

  // src/components/icons/DriveIcon.tsx
  var import_react124 = __toESM(require_react());
  var DriveIcon = () => {
    return /* @__PURE__ */ import_react124.default.createElement("svg", { width: "17", height: "13", viewBox: "0 0 17 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react124.default.createElement("path", { d: "M15.6711 7.6579V11.5C15.6711 11.9142 15.3353 12.25 14.9211 12.25H1.5C1.08579 12.25 0.75 11.9142 0.75 11.5V7.6579C0.75 7.24368 1.08579 6.9079 1.5 6.9079H4.10526H14.9211C15.3353 6.9079 15.6711 7.24368 15.6711 7.6579Z", stroke: "#494650", strokeWidth: "1.5" }), /* @__PURE__ */ import_react124.default.createElement("path", { d: "M14.5503 2.63128L15.4318 6.43421H0.989295L1.87037 2.63151C2.08764 1.69377 2.16023 1.44349 2.28529 1.26975C2.42019 1.08234 2.60436 0.935958 2.81738 0.846842C3.01487 0.764224 3.27508 0.75 4.23766 0.75H8.21021H12.183C13.1455 0.75 13.4057 0.764222 13.6032 0.846828C13.8162 0.935931 14.0003 1.08229 14.1352 1.26968C14.2603 1.4434 14.3329 1.69365 14.5503 2.63128Z", stroke: "#494650", strokeWidth: "1.5" }), /* @__PURE__ */ import_react124.default.createElement("circle", { cx: "10.6052", cy: "9.23683", r: "1.02632", fill: "#494650" }), /* @__PURE__ */ import_react124.default.createElement("path", { d: "M14.3683 9.23683C14.3683 9.80364 13.9088 10.2631 13.342 10.2631C12.7752 10.2631 12.3157 9.80364 12.3157 9.23683C12.3157 8.67001 12.7752 8.21051 13.342 8.21051C13.9088 8.21051 14.3683 8.67001 14.3683 9.23683Z", fill: "#494650" }));
  };
  var DriveIcon_default = DriveIcon;

  // src/components/import/FileBrowser/FileBrowserPathSelector.tsx
  function FileBrowserPathSelector(props) {
    var _a;
    const updateSelectedPath = (i) => {
      if (props.pathParts === void 0) {
        return;
      }
      const subPathParts = props.pathParts.slice(0, i + 1);
      props.setCurrPathParts(subPathParts);
    };
    return /* @__PURE__ */ import_react125.default.createElement("div", { className: "file-browser-path-selector" }, (_a = props.pathParts) == null ? void 0 : _a.map((pathPart, i) => {
      return /* @__PURE__ */ import_react125.default.createElement(import_react125.default.Fragment, { key: i }, /* @__PURE__ */ import_react125.default.createElement("div", { className: "file-browser-path-part", key: i, onClick: () => {
        updateSelectedPath(i);
      } }, i === 0 ? /* @__PURE__ */ import_react125.default.createElement(DriveIcon_default, null) : pathPart), /* @__PURE__ */ import_react125.default.createElement("div", { className: "file-browser-path-seperator" }, ">"));
    }));
  }
  var FileBrowserPathSelector_default = FileBrowserPathSelector;

  // src/components/import/FileBrowser/FileBrowserBody.tsx
  function FileBrowserBody(props) {
    const inputRef = (0, import_react126.useRef)(null);
    const elementsToDisplay = getElementsToDisplay(props.fileBrowserState);
    const selectedFile = elementsToDisplay[props.fileBrowserState.selectedElementIndex];
    (0, import_react126.useEffect)(() => {
      var _a;
      props.setFileBrowserState((prevImportState) => {
        return __spreadProps(__spreadValues({}, prevImportState), {
          searchString: ""
        });
      });
      (_a = inputRef.current) == null ? void 0 : _a.focus();
    }, [props.fileBrowserState.pathContents.path_parts]);
    (0, import_react126.useEffect)(() => {
      var _a;
      (_a = inputRef.current) == null ? void 0 : _a.focus();
    }, [props.fileBrowserState.selectedElementIndex, props.fileBrowserState.sort]);
    const displayUpgradeToPro = inRootFolder(props.fileBrowserState.pathContents.path_parts) && !props.userProfile.isPro;
    return /* @__PURE__ */ import_react126.default.createElement("div", { className: "file-browser flexbox-column" }, /* @__PURE__ */ import_react126.default.createElement("div", null, /* @__PURE__ */ import_react126.default.createElement(
      FileBrowserPathSelector_default,
      {
        setCurrPathParts: props.setCurrPathParts,
        pathParts: props.fileBrowserState.pathContents.path_parts
      }
    )), /* @__PURE__ */ import_react126.default.createElement(Row_default, { className: "border-t-light-gray border-b-light-gray", justify: "space-between" }, /* @__PURE__ */ import_react126.default.createElement(
      Col_default,
      {
        span: 18,
        className: "flexbox-row flexbox-space-between border-r-light-gray",
        onClick: () => {
          props.setFileBrowserState((prevImportState) => {
            return __spreadProps(__spreadValues({}, prevImportState), {
              sort: prevImportState.sort === "name_descending" ? "name_ascending" : "name_descending"
            });
          });
        }
      },
      /* @__PURE__ */ import_react126.default.createElement("p", { className: "text-body-2 pt-5px pb-5px" }, "Name"),
      props.fileBrowserState.sort.startsWith("name") && /* @__PURE__ */ import_react126.default.createElement("div", { className: "mr-5px ml-5px" }, /* @__PURE__ */ import_react126.default.createElement(SortArrowIcon_default, { direction: props.fileBrowserState.sort.endsWith("descending") ? "descending" : "ascending" }))
    ), /* @__PURE__ */ import_react126.default.createElement(
      Col_default,
      {
        span: 6,
        className: "flexbox-row flexbox-justify-end text-align-right",
        onClick: () => {
          props.setFileBrowserState((prevImportState) => {
            return __spreadProps(__spreadValues({}, prevImportState), {
              sort: prevImportState.sort === "last_modified_descending" ? "last_modified_ascending" : "last_modified_descending"
            });
          });
        }
      },
      props.fileBrowserState.sort.startsWith("last_modified") && /* @__PURE__ */ import_react126.default.createElement("div", { className: "mr-5px ml-5px" }, /* @__PURE__ */ import_react126.default.createElement(SortArrowIcon_default, { direction: props.fileBrowserState.sort.endsWith("descending") ? "descending" : "ascending" })),
      /* @__PURE__ */ import_react126.default.createElement(
        "p",
        {
          className: "text-body-2 pt-5px pb-5px"
        },
        "Last Modified"
      )
    )), /* @__PURE__ */ import_react126.default.createElement("div", { className: "mt-5px mb-5px" }, /* @__PURE__ */ import_react126.default.createElement(
      "input",
      {
        className: classNames("mito-input", "text-body-2", "element-width-block"),
        ref: inputRef,
        value: props.fileBrowserState.searchString,
        placeholder: "Search the current folder",
        onChange: (e) => {
          const newSearchString = e.target.value;
          props.setFileBrowserState((prevImportState) => {
            return __spreadProps(__spreadValues({}, prevImportState), {
              searchString: newSearchString
            });
          });
        },
        onKeyDown: (e) => {
          if (e.key == "ArrowUp") {
            props.setFileBrowserState((prevImportState) => {
              return __spreadProps(__spreadValues({}, prevImportState), {
                selectedElementIndex: Math.max(prevImportState.selectedElementIndex - 1, -1)
              });
            });
            e.preventDefault();
          } else if (e.key === "ArrowDown") {
            props.setFileBrowserState((prevImportState) => {
              return __spreadProps(__spreadValues({}, prevImportState), {
                selectedElementIndex: Math.min(prevImportState.selectedElementIndex + 1, elementsToDisplay.length - 1)
              });
            });
            e.preventDefault();
          } else if (e.key === "Enter") {
            if (!selectedFile) {
              return;
            }
            if (selectedFile.isParentDirectory) {
              const newPathParts = [...props.fileBrowserState.pathContents.path_parts];
              newPathParts.pop();
              props.setCurrPathParts(newPathParts);
            } else if (selectedFile.isDirectory) {
              const newPathParts = props.fileBrowserState.pathContents.path_parts || [];
              newPathParts.push(selectedFile.name);
              props.setCurrPathParts(newPathParts);
            } else {
              if (isExcelFile(selectedFile)) {
                const openExcelImport = async () => {
                  const filePath = await getFilePath(props.mitoAPI, props.currPathParts, selectedFile);
                  if (filePath === void 0 || selectedFile === void 0) {
                    return;
                  }
                  props.setImportState({
                    screen: "xlsx_import_config",
                    fileName: selectedFile.name,
                    filePath
                  });
                };
                void openExcelImport();
              } else {
                void props.importCSVFile(selectedFile);
              }
            }
          }
        },
        width: "block",
        autoFocus: true
      }
    )), /* @__PURE__ */ import_react126.default.createElement("div", { className: "file-browser-element-list" }, displayUpgradeToPro && /* @__PURE__ */ import_react126.default.createElement(import_react126.default.Fragment, null, /* @__PURE__ */ import_react126.default.createElement(Row_default, { justify: "space-around" }, /* @__PURE__ */ import_react126.default.createElement("p", { className: "ma-25px text-align-center text-body-1" }, "Want to import from a different drive? Consider\xA0", /* @__PURE__ */ import_react126.default.createElement(
      "a",
      {
        onClick: () => {
          void props.mitoAPI.log("clicked_pro_button", {
            "pro_button_location": "import_taskpane_root_folder_import"
          });
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "upgrade_to_pro" /* UPGRADE_TO_PRO */ },
              selectedTabType: "data"
            });
          });
        },
        className: "text-body-1-link"
      },
      "upgrading to Mito Pro"
    ), " or\xA0", /* @__PURE__ */ import_react126.default.createElement(
      "a",
      {
        onClick: () => {
          props.setCurrPathParts(["."]);
        },
        className: "text-body-1-link"
      },
      "go back to current directory."
    )))), !displayUpgradeToPro && /* @__PURE__ */ import_react126.default.createElement(import_react126.default.Fragment, null, !props.fileBrowserState.loadingFolder && (elementsToDisplay == null ? void 0 : elementsToDisplay.map((element, i) => {
      return /* @__PURE__ */ import_react126.default.createElement(
        FileBrowserElement_default,
        {
          key: i,
          mitoAPI: props.mitoAPI,
          index: i,
          element,
          fileBrowserState: props.fileBrowserState,
          setFileBrowserState: props.setFileBrowserState,
          currPathParts: props.currPathParts,
          setCurrPathParts: props.setCurrPathParts,
          excelImportEnabled: isExcelImportEnabled(props.userProfile),
          setImportState: props.setImportState,
          importCSVFile: props.importCSVFile
        }
      );
    })), props.fileBrowserState.loadingFolder && /* @__PURE__ */ import_react126.default.createElement("p", null, "Loading folder contents..."))));
  }
  var FileBrowserBody_default = FileBrowserBody;

  // src/components/import/FileBrowser/FileBrowser.tsx
  function FileBrowser(props) {
    const [fileBrowserState, setFileBrowserState] = (0, import_react127.useState)({
      pathContents: {
        path_parts: props.currPathParts,
        elements: []
      },
      sort: "last_modified_descending",
      searchString: "",
      selectedElementIndex: -1,
      loadingFolder: false,
      loadingImport: false
    });
    const selectedFile = getElementsToDisplay(fileBrowserState)[fileBrowserState.selectedElementIndex];
    (0, import_react127.useEffect)(() => {
      void loadPathContents(props.currPathParts);
      setFileBrowserState((prevImportState) => {
        return __spreadProps(__spreadValues({}, prevImportState), {
          selectedElementIndex: -1
        });
      });
      void props.mitoAPI.log("curr_path_changed", { "path_parts_length": props.currPathParts.length });
    }, [props.currPathParts]);
    (0, import_react127.useEffect)(() => {
      let selectedElementName = "";
      if (selectedFile === void 0) {
        selectedElementName = "undefined";
      } else if (selectedFile.isDirectory) {
        selectedElementName = "directory";
      } else {
        const fileEnding = getFileEnding(selectedFile.name);
        if (fileEnding !== void 0) {
          selectedElementName = fileEnding;
        } else {
          selectedElementName = "No File Ending";
        }
      }
      void props.mitoAPI.log(
        "selected_element_changed",
        { "selected_element": selectedElementName }
      );
    }, [selectedFile]);
    async function loadPathContents(currPathParts) {
      setFileBrowserState((prevImportState) => {
        return __spreadProps(__spreadValues({}, prevImportState), {
          loadingFolder: true
        });
      });
      const _pathContents = await props.mitoAPI.getPathContents(currPathParts);
      if (_pathContents) {
        setFileBrowserState((prevImportState) => {
          return __spreadProps(__spreadValues({}, prevImportState), {
            pathContents: _pathContents,
            loadingFolder: false
          });
        });
      } else {
        setFileBrowserState((prevImportState) => {
          return __spreadProps(__spreadValues({}, prevImportState), {
            loadingFolder: false
          });
        });
      }
    }
    const importButtonStatus = getImportButtonStatus(
      selectedFile,
      isExcelImportEnabled(props.userProfile),
      fileBrowserState.loadingImport,
      props.isUpdate
    );
    return /* @__PURE__ */ import_react127.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react127.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: !props.isUpdate ? "Import Files" : "Update Import",
        setUIState: props.setUIState,
        backCallback: props.backCallback,
        notCloseable: props.notCloseable
      }
    ), /* @__PURE__ */ import_react127.default.createElement(DefaultTaskpaneBody_default, { noScroll: true }, /* @__PURE__ */ import_react127.default.createElement(
      FileBrowserBody_default,
      {
        mitoAPI: props.mitoAPI,
        userProfile: props.userProfile,
        setUIState: props.setUIState,
        currPathParts: props.currPathParts,
        setCurrPathParts: props.setCurrPathParts,
        fileBrowserState,
        setFileBrowserState,
        importCSVFile: props.importCSVFile,
        setImportState: props.setImportState
      }
    )), /* @__PURE__ */ import_react127.default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ import_react127.default.createElement(Row_default, { justify: "space-between" }, !importButtonStatus.disabled && !isExcelFile(selectedFile) && /* @__PURE__ */ import_react127.default.createElement(Col_default, null, /* @__PURE__ */ import_react127.default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "small",
        onClick: () => {
          const openCSVImport = async () => {
            const filePath = await getFilePath(props.mitoAPI, props.currPathParts, selectedFile);
            if (filePath === void 0 || selectedFile === void 0) {
              return;
            }
            props.setImportState({
              screen: "csv_import_config",
              fileName: selectedFile.name,
              filePath
            });
          };
          void openCSVImport();
        },
        disabled: importButtonStatus.disabled
      },
      /* @__PURE__ */ import_react127.default.createElement(Row_default, { suppressTopBottomMargin: true, justify: "space-between", align: "center" }, /* @__PURE__ */ import_react127.default.createElement(ConfigureIcon_default, null), /* @__PURE__ */ import_react127.default.createElement("p", { className: "ml-2px" }, "Configure"))
    )), /* @__PURE__ */ import_react127.default.createElement(Col_default, { span: !importButtonStatus.disabled && !isExcelFile(selectedFile) ? 18 : 24 }, /* @__PURE__ */ import_react127.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          if (isExcelFile(selectedFile)) {
            const openExcelImport = async () => {
              const filePath = await getFilePath(props.mitoAPI, props.currPathParts, selectedFile);
              if (filePath === void 0 || selectedFile === void 0) {
                return;
              }
              props.setImportState({
                screen: "xlsx_import_config",
                fileName: selectedFile.name,
                filePath
              });
            };
            void openExcelImport();
          } else {
            void props.importCSVFile(selectedFile);
          }
        },
        disabled: importButtonStatus.disabled
      },
      importButtonStatus.buttonText
    )))));
  }
  var FileBrowser_default = FileBrowser;

  // src/components/taskpanes/FileImport/CSVImportConfigTaskpane.tsx
  var import_react129 = __toESM(require_react());

  // src/components/import/CSVImportConfigScreen.tsx
  var import_react128 = __toESM(require_react());
  var ENCODINGS = [
    "utf_8",
    "ascii",
    "latin_1",
    "big5",
    "big5hkscs",
    "cp037",
    "cp273",
    "cp424",
    "cp437",
    "cp500",
    "cp720",
    "cp737",
    "cp775",
    "cp850",
    "cp852",
    "cp855",
    "cp856",
    "cp857",
    "cp858",
    "cp860",
    "cp861",
    "cp862",
    "cp863",
    "cp864",
    "cp865",
    "cp866",
    "cp869",
    "cp874",
    "cp875",
    "cp932",
    "cp949",
    "cp950",
    "cp1006",
    "cp1026",
    "cp1125",
    "cp1140",
    "cp1250",
    "cp1251",
    "cp1252",
    "cp1253",
    "cp1254",
    "cp1255",
    "cp1256",
    "cp1257",
    "cp1258",
    "euc_jp",
    "euc_jis_2004",
    "euc_jisx0213",
    "euc_kr",
    "gb2312",
    "gbk",
    "gb18030",
    "hz",
    "iso2022_jp",
    "iso2022_jp_1",
    "iso2022_jp_2",
    "iso2022_jp_2004",
    "iso2022_jp_3",
    "iso2022_jp_ext",
    "iso2022_kr",
    "iso8859_2",
    "iso8859_3",
    "iso8859_4",
    "iso8859_5",
    "iso8859_6",
    "iso8859_7",
    "iso8859_8",
    "iso8859_9",
    "iso8859_10",
    "iso8859_11",
    "iso8859_13",
    "iso8859_14",
    "iso8859_15",
    "iso8859_16",
    "johab",
    "koi8_r",
    "koi8_t",
    "koi8_u",
    "kz1048",
    "mac_cyrillic",
    "mac_greek",
    "mac_iceland",
    "mac_latin2",
    "mac_roman",
    "mac_turkish",
    "ptcp154",
    "shift_jis",
    "shift_jis_2004",
    "shift_jisx0213",
    "utf_32",
    "utf_32_be",
    "utf_32_le",
    "utf_16",
    "utf_16_be",
    "utf_16_le",
    "utf_7",
    "utf_8_sig"
  ];
  var decimalCharToTitle = {
    ["." /* PERIOD */]: "period",
    ["," /* COMMA */]: "comma"
  };
  var DELIMETER_TOOLTIP = "The seperator that seperates one column from another.";
  var ENCODING_TOOLTIP = "The encoding used to save this file.";
  var DECIMAL_TOOLTIP = "The character used to separate the decimal places in numbers.";
  var SKIP_ROWS_TOOLTIP = "The number of rows at the top of the file to skip when reading data into the dataframe.";
  var ERROR_BAD_LINES_TOOLTIP = "Turn on to skip any lines that error when being read in.";
  var DEFAULT_DELIMETER = ",";
  var DEFAULT_ENCODING = "utf-8";
  var DEFAULT_DECIMAL = "." /* PERIOD */;
  var DEFAULT_SKIPROWS = 0;
  var DEFAULT_ERROR_BAD_LINES = true;
  var getButtonMessage2 = (fileName, loading, isUpdate) => {
    if (loading) {
      return `Importing...`;
    } else if (isUpdate) {
      return `Update to ${fileName}`;
    }
    return `Import ${fileName}`;
  };
  function getSuccessMessage(fileName) {
    return `Imported ${fileName}`;
  }
  function CSVImportConfigScreen(props) {
    const [fileMetadata] = useStateFromAPIAsync(
      void 0,
      () => {
        var _a;
        return props.mitoAPI.getCSVFilesMetadata(((_a = props.params) == null ? void 0 : _a.file_names) || []);
      },
      (loadedData) => {
        props.setParams((prevParams) => {
          return __spreadProps(__spreadValues({}, prevParams), {
            delimeters: (loadedData == null ? void 0 : loadedData.delimeters) || [DEFAULT_DELIMETER],
            encodings: (loadedData == null ? void 0 : loadedData.encodings) || [DEFAULT_ENCODING],
            decimals: (loadedData == null ? void 0 : loadedData.decimals) || [DEFAULT_DECIMAL],
            skiprows: (loadedData == null ? void 0 : loadedData.skiprows) || [DEFAULT_SKIPROWS]
          });
        });
      },
      []
    );
    const resetParams = () => {
      props.setParams((prevParams) => {
        return __spreadProps(__spreadValues({}, prevParams), {
          delimeters: (fileMetadata == null ? void 0 : fileMetadata.delimeters) || [DEFAULT_DELIMETER],
          encodings: (fileMetadata == null ? void 0 : fileMetadata.encodings) || [DEFAULT_ENCODING],
          decimals: (fileMetadata == null ? void 0 : fileMetadata.decimals) || [DEFAULT_DECIMAL],
          skiprows: (fileMetadata == null ? void 0 : fileMetadata.skiprows) || [DEFAULT_SKIPROWS],
          error_bad_lines: [DEFAULT_ERROR_BAD_LINES]
        });
      });
    };
    if (props.params === void 0 || props.fileName === void 0 || props.filePath === void 0) {
      return /* @__PURE__ */ import_react128.default.createElement("div", { className: "text-body-1" }, "There has been an error loading your CSV file encodings. Please try again, or contact support.");
    }
    const delimeters = props.params.delimeters;
    const encodings = props.params.encodings;
    const decimals = props.params.decimals;
    const skiprows = props.params.skiprows;
    const error_bad_lines = props.params.error_bad_lines;
    const currentDelimeter = delimeters !== void 0 ? delimeters[0] : DEFAULT_DELIMETER;
    const currentEncoding = encodings !== void 0 ? encodings[0] : DEFAULT_ENCODING;
    const currentDecimal = decimals !== void 0 ? decimals[0] : DEFAULT_DECIMAL;
    const currentSkiprows = skiprows !== void 0 ? skiprows[0] : DEFAULT_SKIPROWS;
    const currentErrorBadLines = error_bad_lines !== void 0 ? error_bad_lines[0] : DEFAULT_ERROR_BAD_LINES;
    return /* @__PURE__ */ import_react128.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react128.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: !props.isUpdate ? `Import ${props.fileName}` : `Update to ${props.fileName}`,
        setUIState: props.setUIState,
        backCallback: props.backCallback,
        notCloseable: props.notCloseable
      }
    ), /* @__PURE__ */ import_react128.default.createElement(DefaultTaskpaneBody_default, { noScroll: true }, props.error !== void 0 && /* @__PURE__ */ import_react128.default.createElement("p", { className: "text-color-error" }, " ", props.error, " "), /* @__PURE__ */ import_react128.default.createElement(Row_default, { justify: "space-between", align: "center", title: DELIMETER_TOOLTIP }, /* @__PURE__ */ import_react128.default.createElement(Col_default, null, /* @__PURE__ */ import_react128.default.createElement(LabelAndTooltip_default, { tooltip: DELIMETER_TOOLTIP }, "Delimeter")), /* @__PURE__ */ import_react128.default.createElement(Col_default, null, /* @__PURE__ */ import_react128.default.createElement(
      Input_default,
      {
        width: "medium",
        value: currentDelimeter,
        onChange: (e) => {
          const newDelimeter = e.target.value;
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              delimeters: [newDelimeter]
            });
          });
        },
        onKeyDown: (e) => {
          if (e.key === "Tab") {
            e.preventDefault();
            props.setParams((prevParams) => {
              const delimeters2 = prevParams.delimeters;
              return __spreadProps(__spreadValues({}, prevParams), {
                delimeters: [(delimeters2 !== void 0 ? delimeters2[0] : DEFAULT_DELIMETER) + "	"]
              });
            });
          }
        },
        selectTextOnFocus: true
      }
    ))), /* @__PURE__ */ import_react128.default.createElement(Row_default, { justify: "space-between", align: "center", title: ENCODING_TOOLTIP }, /* @__PURE__ */ import_react128.default.createElement(Col_default, null, /* @__PURE__ */ import_react128.default.createElement(LabelAndTooltip_default, { tooltip: ENCODING_TOOLTIP }, "Encoding")), /* @__PURE__ */ import_react128.default.createElement(Col_default, null, /* @__PURE__ */ import_react128.default.createElement(
      Select_default,
      {
        searchable: true,
        width: "medium",
        value: currentEncoding,
        onChange: (newEncoding) => {
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              encodings: [newEncoding]
            });
          });
        }
      },
      ENCODINGS.map((encoding) => {
        return /* @__PURE__ */ import_react128.default.createElement(DropdownItem_default, { key: encoding, title: encoding });
      })
    ))), /* @__PURE__ */ import_react128.default.createElement(Row_default, { justify: "space-between", align: "center", title: DECIMAL_TOOLTIP }, /* @__PURE__ */ import_react128.default.createElement(Col_default, null, /* @__PURE__ */ import_react128.default.createElement(LabelAndTooltip_default, { tooltip: DECIMAL_TOOLTIP }, "Decimal Separator")), /* @__PURE__ */ import_react128.default.createElement(Col_default, null, /* @__PURE__ */ import_react128.default.createElement(
      Select_default,
      {
        searchable: true,
        width: "medium",
        value: decimalCharToTitle[currentDecimal],
        onChange: (newDecimalSeparator) => {
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              decimals: [newDecimalSeparator]
            });
          });
        }
      },
      Object.keys(decimalCharToTitle).map((decimalCharacter) => {
        const decimalTitle = decimalCharToTitle[decimalCharacter];
        return /* @__PURE__ */ import_react128.default.createElement(DropdownItem_default, { key: decimalTitle, title: decimalTitle, id: decimalCharacter });
      })
    ))), /* @__PURE__ */ import_react128.default.createElement(Row_default, { justify: "space-between", align: "center", title: SKIP_ROWS_TOOLTIP }, /* @__PURE__ */ import_react128.default.createElement(Col_default, null, /* @__PURE__ */ import_react128.default.createElement(LabelAndTooltip_default, { tooltip: SKIP_ROWS_TOOLTIP }, "Number of Rows to Skip")), /* @__PURE__ */ import_react128.default.createElement(Col_default, null, /* @__PURE__ */ import_react128.default.createElement(
      Input_default,
      {
        value: "" + currentSkiprows,
        type: "number",
        width: "medium",
        onChange: (e) => {
          const newSkiprows = e.target.value;
          const newSkiprowsNumber = Math.floor(parseFloat(newSkiprows));
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              skiprows: [newSkiprowsNumber]
            });
          });
        },
        selectTextOnFocus: true
      }
    ))), /* @__PURE__ */ import_react128.default.createElement(Row_default, { justify: "space-between", align: "center", title: ERROR_BAD_LINES_TOOLTIP }, /* @__PURE__ */ import_react128.default.createElement(Col_default, null, /* @__PURE__ */ import_react128.default.createElement(LabelAndTooltip_default, { tooltip: ERROR_BAD_LINES_TOOLTIP }, "Skip Invalid Lines")), /* @__PURE__ */ import_react128.default.createElement(Col_default, null, /* @__PURE__ */ import_react128.default.createElement(Toggle_default, { value: !currentErrorBadLines, onChange: () => {
      props.setParams((prevParams) => {
        const error_bad_lines2 = prevParams.error_bad_lines;
        return __spreadProps(__spreadValues({}, prevParams), {
          error_bad_lines: [error_bad_lines2 !== void 0 ? !error_bad_lines2[0] : DEFAULT_ERROR_BAD_LINES]
        });
      });
    } })))), /* @__PURE__ */ import_react128.default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ import_react128.default.createElement("p", { className: "text-body-2 text-color-medium-gray-important mb-5px" }, /* @__PURE__ */ import_react128.default.createElement("span", { className: "text-body-2-link", onClick: resetParams }, "Reset parameters to automatically detected parameters. ")), /* @__PURE__ */ import_react128.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          props.edit();
        },
        autoFocus: true
      },
      getButtonMessage2(props.fileName, props.loading, props.isUpdate)
    ), props.editApplied && !props.loading && /* @__PURE__ */ import_react128.default.createElement("p", { className: "text-subtext-1" }, getSuccessMessage(props.fileName)), !props.editApplied && /* @__PURE__ */ import_react128.default.createElement(Spacer_default, { px: 16 })));
  }
  var CSVImportConfigScreen_default = CSVImportConfigScreen;

  // src/components/taskpanes/FileImport/CSVImportConfigTaskpane.tsx
  var getDefaultCSVParams = (filePath) => {
    return {
      file_names: [filePath],
      delimeters: [DEFAULT_DELIMETER],
      encodings: [DEFAULT_ENCODING],
      error_bad_lines: [DEFAULT_ERROR_BAD_LINES]
    };
  };
  function CSVImportConfigTaskpane(props) {
    const { params, setParams, loading, edit, editApplied, error } = useSendEditOnClick_default(
      () => getDefaultCSVParams(props.filePath),
      "simple_import" /* SimpleImport */,
      props.mitoAPI,
      props.analysisData,
      { allowSameParamsToReapplyTwice: true }
    );
    return /* @__PURE__ */ import_react129.default.createElement(
      CSVImportConfigScreen_default,
      {
        mitoAPI: props.mitoAPI,
        analysisData: props.analysisData,
        setUIState: props.setUIState,
        isUpdate: false,
        fileName: props.fileName,
        filePath: props.filePath,
        params,
        setParams,
        edit,
        editApplied,
        loading,
        error: error !== void 0 ? error : props.error,
        backCallback: () => {
          props.setScreen({ screen: "file_browser" });
        }
      }
    );
  }
  var CSVImportConfigTaskpane_default = CSVImportConfigTaskpane;

  // src/components/taskpanes/FileImport/XLSXImportConfigTaskpane.tsx
  var import_react133 = __toESM(require_react());

  // src/components/import/XLSXImportConfigScreen.tsx
  var import_react132 = __toESM(require_react());

  // src/components/elements/RadioButtonBox.tsx
  var import_react131 = __toESM(require_react());

  // src/components/elements/RadioButtonItem.tsx
  var import_react130 = __toESM(require_react());
  var RadioButtonItem = (props) => {
    return /* @__PURE__ */ import_react130.default.createElement(
      "div",
      {
        key: props.value,
        onClick: () => {
          props.onClick();
        },
        className: classNames("radio-button-box-row", { "radio-button-box-row-selected": props.checked })
      },
      /* @__PURE__ */ import_react130.default.createElement("input", { type: "radio", name: props.value, value: props.value, checked: props.checked }),
      /* @__PURE__ */ import_react130.default.createElement("label", { htmlFor: props.value }, props.value)
    );
  };
  var RadioButtonItem_default = RadioButtonItem;

  // src/components/elements/RadioButtonBox.tsx
  var RadioButtonBoxMessage = (props) => {
    if (props.loading) {
      return /* @__PURE__ */ import_react131.default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ import_react131.default.createElement("p", { className: "text-body-1" }, "Loading..."));
    } else if (props.values.length === 0) {
      return /* @__PURE__ */ import_react131.default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ import_react131.default.createElement("p", { className: "text-body-1" }, "No items to display."));
    }
    return null;
  };
  var RadioButtonBox = (props) => {
    const height = props.height || "block";
    const width = props.width || "block";
    const heightClass = `element-height-${height}`;
    const widthClass = `element-width-${width}`;
    return /* @__PURE__ */ import_react131.default.createElement(
      "div",
      {
        className: classNames("text-body-2", "radio-button-box", heightClass, widthClass, props.className)
      },
      /* @__PURE__ */ import_react131.default.createElement(
        RadioButtonBoxMessage,
        {
          values: props.values,
          loading: props.loading
        }
      ),
      props.values.map((value) => {
        return /* @__PURE__ */ import_react131.default.createElement(
          RadioButtonItem_default,
          {
            key: value,
            value,
            checked: value == props.selectedValue,
            onClick: () => {
              props.onChange(value);
            }
          }
        );
      })
    );
  };
  var RadioButtonBox_default = RadioButtonBox;

  // src/components/import/XLSXImportConfigScreen.tsx
  var getButtonMessage3 = (params, loading, isUpdate) => {
    if (loading) {
      return `Importing...`;
    } else if (params.sheet_names.length === 0) {
      return `Select sheets to import them`;
    } else if (isUpdate) {
      return `Update to ${params.sheet_names[0]}`;
    }
    return `Import ${params.sheet_names.length} Selected Sheet${params.sheet_names.length === 1 ? "" : "s"}`;
  };
  function getSuccessMessage2(params) {
    return `Imported ${params.sheet_names.length} sheet${params.sheet_names.length === 1 ? "" : "s"}.`;
  }
  var HAS_HEADER_ROW_TOOLTIP = 'Select "Yes" if Mito should set the first non-skipped row as the column headers. Select "No" if Mito should generate column headers';
  function XLSXImportConfigScreen(props) {
    const [fileMetadata, loading] = useStateFromAPIAsync(
      { sheet_names: [], size: 0 },
      (filePath) => {
        return props.mitoAPI.getExcelFileMetadata(filePath);
      },
      (loadedData) => {
        if (loadedData !== void 0) {
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              sheet_names: !props.isUpdate ? loadedData.sheet_names : loadedData.sheet_names.slice(0, 1)
            });
          });
        }
      },
      [props.filePath]
    );
    const params = props.params;
    if (params === void 0) {
      return /* @__PURE__ */ import_react132.default.createElement("div", { className: "text-body-1" }, "There has been an error loading your Excel file metadata. Please try again, or contact support.");
    }
    const numSelectedSheets = params.sheet_names.length;
    return /* @__PURE__ */ import_react132.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react132.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: !props.isUpdate ? `Import ${props.fileName}` : `Update to ${props.fileName}`,
        setUIState: props.setUIState,
        backCallback: props.backCallback,
        notCloseable: props.notCloseable
      }
    ), /* @__PURE__ */ import_react132.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react132.default.createElement("div", null, !props.isUpdate && /* @__PURE__ */ import_react132.default.createElement(
      MultiToggleBox_default,
      {
        loading,
        searchable: true,
        height: "medium",
        emptyMessage: "There are no sheets to choose from. Either the workbook is empty or password protected.",
        onToggleAll: (newSelectedIndexes) => {
          props.setParams((prevParams) => {
            const newSheetNames = newSelectedIndexes.map((index) => fileMetadata.sheet_names[index]);
            return __spreadProps(__spreadValues({}, prevParams), {
              sheet_names: newSheetNames
            });
          });
        }
      },
      fileMetadata.sheet_names.map((sheetName, idx) => {
        return /* @__PURE__ */ import_react132.default.createElement(
          MultiToggleItem_default,
          {
            key: idx,
            title: sheetName,
            toggled: params.sheet_names.includes(sheetName),
            onToggle: () => {
              props.setParams((prevParams) => {
                const newSheetNames = [...prevParams.sheet_names];
                toggleInArray(newSheetNames, sheetName);
                return __spreadProps(__spreadValues({}, prevParams), {
                  sheet_names: newSheetNames
                });
              });
            },
            index: idx
          }
        );
      })
    ), props.isUpdate && /* @__PURE__ */ import_react132.default.createElement(
      RadioButtonBox_default,
      {
        values: fileMetadata.sheet_names,
        selectedValue: params.sheet_names[0],
        height: "medium",
        onChange: (value) => props.setParams((prevParams) => {
          return __spreadProps(__spreadValues({}, prevParams), {
            sheet_names: [value]
          });
        }),
        loading
      }
    ), /* @__PURE__ */ import_react132.default.createElement(Row_default, { justify: "space-between", align: "center", title: HAS_HEADER_ROW_TOOLTIP }, /* @__PURE__ */ import_react132.default.createElement(Col_default, null, /* @__PURE__ */ import_react132.default.createElement(LabelAndTooltip_default, { tooltip: HAS_HEADER_ROW_TOOLTIP }, "Has Header Row")), /* @__PURE__ */ import_react132.default.createElement(Col_default, null, /* @__PURE__ */ import_react132.default.createElement(
      Select_default,
      {
        value: params.has_headers ? "Yes" : "No",
        width: "medium",
        onChange: (newValue) => props.setParams((prevParams) => {
          return __spreadProps(__spreadValues({}, prevParams), {
            has_headers: newValue === "Yes"
          });
        })
      },
      /* @__PURE__ */ import_react132.default.createElement(
        DropdownItem_default,
        {
          title: "Yes"
        }
      ),
      /* @__PURE__ */ import_react132.default.createElement(
        DropdownItem_default,
        {
          title: "No"
        }
      )
    ))), /* @__PURE__ */ import_react132.default.createElement(Row_default, { justify: "space-between", align: "center", title: SKIP_ROWS_TOOLTIP }, /* @__PURE__ */ import_react132.default.createElement(Col_default, null, /* @__PURE__ */ import_react132.default.createElement(LabelAndTooltip_default, { tooltip: SKIP_ROWS_TOOLTIP }, "Number of Rows to Skip")), /* @__PURE__ */ import_react132.default.createElement(Col_default, null, /* @__PURE__ */ import_react132.default.createElement(
      Input_default,
      {
        value: "" + params.skiprows,
        type: "number",
        width: "medium",
        onChange: (e) => {
          const newValue = e.target.value;
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              skiprows: newValue
            });
          });
        }
      }
    ))), isAtLeastBenchmarkVersion(props.userProfile.pandasVersion, "1.4.0") && /* @__PURE__ */ import_react132.default.createElement(Row_default, { justify: "space-between", align: "center", title: DECIMAL_TOOLTIP }, /* @__PURE__ */ import_react132.default.createElement(Col_default, null, /* @__PURE__ */ import_react132.default.createElement(LabelAndTooltip_default, { tooltip: DECIMAL_TOOLTIP }, "Decimal Separator")), /* @__PURE__ */ import_react132.default.createElement(Col_default, null, /* @__PURE__ */ import_react132.default.createElement(
      Select_default,
      {
        width: "medium",
        value: decimalCharToTitle[params.decimal],
        onChange: (newDecimalSeparator) => {
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              decimals: [newDecimalSeparator]
            });
          });
        }
      },
      Object.keys(decimalCharToTitle).map((decimalCharacter) => {
        const decimalTitle = decimalCharToTitle[decimalCharacter];
        return /* @__PURE__ */ import_react132.default.createElement(DropdownItem_default, { key: decimalTitle, title: decimalTitle, id: decimalCharacter });
      })
    ))), !props.isUpdate && params.sheet_names.length === 1 && /* @__PURE__ */ import_react132.default.createElement(
      "p",
      {
        onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: {
                type: "Excel Range Import" /* EXCEL_RANGE_IMPORT */,
                file_path: props.filePath,
                sheet_name: params.sheet_names[0]
              }
            });
          });
        }
      },
      "Want to import multiple ranges from ",
      params.sheet_names[0],
      "? ",
      /* @__PURE__ */ import_react132.default.createElement("span", { className: "text-underline" }, "Click here.")
    ), fileMetadata.size >= 1e5 && fileMetadata.size < 1e7 && /* @__PURE__ */ import_react132.default.createElement("p", { className: "text-body-2 mt-20px" }, "Due to Python limitations, large Excel files take minutes to import."), fileMetadata.size >= 1e7 && /* @__PURE__ */ import_react132.default.createElement("p", { className: "text-body-2 mt-20px" }, "Due to Python limitations, massive Excel files take many minutes to import. If possible, save the Excel file as a CSV before importing."))), /* @__PURE__ */ import_react132.default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ import_react132.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => props.edit((params2) => {
          const parsedSkipRows = parseInt("" + params2.skiprows);
          return __spreadProps(__spreadValues({}, params2), {
            skiprows: parsedSkipRows
          });
        }),
        disabled: numSelectedSheets === 0,
        autoFocus: true
      },
      getButtonMessage3(params, props.loading, props.isUpdate)
    ), props.editApplied && !props.loading && /* @__PURE__ */ import_react132.default.createElement("p", { className: "text-subtext-1" }, getSuccessMessage2(params)), !props.editApplied && /* @__PURE__ */ import_react132.default.createElement(Spacer_default, { px: 18 })));
  }
  var XLSXImportConfigScreen_default = XLSXImportConfigScreen;

  // src/components/taskpanes/FileImport/XLSXImportConfigTaskpane.tsx
  var getDefaultXLSXParams = (filePath) => {
    return {
      file_name: filePath,
      sheet_names: [],
      has_headers: true,
      decimal: DEFAULT_DECIMAL,
      skiprows: 0
    };
  };
  function XLSXImportConfigTaskpane(props) {
    const { params, setParams, loading, edit, editApplied } = useSendEditOnClick_default(
      () => {
        return getDefaultXLSXParams(props.filePath);
      },
      "excel_import" /* ExcelImport */,
      props.mitoAPI,
      props.analysisData,
      { allowSameParamsToReapplyTwice: true }
    );
    return /* @__PURE__ */ import_react133.default.createElement(
      XLSXImportConfigScreen_default,
      {
        mitoAPI: props.mitoAPI,
        analysisData: props.analysisData,
        userProfile: props.userProfile,
        setUIState: props.setUIState,
        isUpdate: false,
        fileName: props.fileName,
        filePath: props.filePath,
        params,
        setParams,
        edit,
        editApplied,
        loading,
        backCallback: () => {
          props.setImportState({ screen: "file_browser" });
        }
      }
    );
  }
  var XLSXImportConfigTaskpane_default = XLSXImportConfigTaskpane;

  // src/components/taskpanes/FileImport/FileImportTaskpane.tsx
  function FileImportTaskpane(props) {
    const [importState, setImportState] = (0, import_react134.useState)({ screen: "file_browser" });
    if (importState.screen === "file_browser") {
      return /* @__PURE__ */ import_react134.default.createElement(
        FileBrowser_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          userProfile: props.userProfile,
          setUIState: props.setUIState,
          isUpdate: false,
          currPathParts: props.currPathParts,
          setCurrPathParts: props.setCurrPathParts,
          setImportState,
          importCSVFile: async (file) => {
            const filePath = await props.mitoAPI.getPathJoined([...props.currPathParts, file.name]);
            if (filePath === void 0) {
              return;
            }
            const result = await props.mitoAPI.editSimpleImport([filePath]);
            if (isMitoError(result)) {
              setImportState({
                screen: "csv_import_config",
                fileName: file.name,
                filePath,
                error: result.to_fix
              });
            }
          }
        }
      );
    } else if (importState.screen == "csv_import_config") {
      return /* @__PURE__ */ import_react134.default.createElement(
        CSVImportConfigTaskpane_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          setUIState: props.setUIState,
          fileName: importState.fileName,
          filePath: importState.filePath,
          error: importState.error,
          setScreen: setImportState
        }
      );
    } else if (importState.screen == "xlsx_import_config") {
      return /* @__PURE__ */ import_react134.default.createElement(
        XLSXImportConfigTaskpane_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          userProfile: props.userProfile,
          setUIState: props.setUIState,
          fileName: importState.fileName,
          filePath: importState.filePath,
          setImportState
        }
      );
    } else {
      return /* @__PURE__ */ import_react134.default.createElement(import_react134.default.Fragment, null);
    }
  }
  var FileImportTaskpane_default = FileImportTaskpane;

  // src/components/taskpanes/FillNa/FillNaTaskpane.tsx
  var import_react135 = __toESM(require_react());
  var BOOLEAN_STRINGS = ["True", "true", "False", "false"];
  var getDefaultParams4 = (sheetDataArray2, sheetIndex, defaultFillMethod, startingColumnIDs) => {
    if (sheetDataArray2.length === 0 || sheetDataArray2[sheetIndex] === void 0) {
      return void 0;
    }
    const sheetData = sheetDataArray2[sheetIndex];
    let finalFillMethod = defaultFillMethod || { type: "value", "value": 0 };
    if (finalFillMethod.type === "mean" || finalFillMethod.type === "median") {
      const onlyMeanAndMedianColumnSelected = Object.values(sheetData.columnDtypeMap).map((columnDtype) => isNumberDtype(columnDtype) || isDatetimeDtype(columnDtype) || isTimedeltaDtype(columnDtype)).every((hasDefinedMeanAndMedian) => hasDefinedMeanAndMedian === true);
      if (!onlyMeanAndMedianColumnSelected) {
        finalFillMethod = { type: "value", "value": 0 };
      }
    }
    const columnIDs = startingColumnIDs === void 0 ? Object.keys(sheetData.columnIDsMap) : intersection(Object.keys(sheetData.columnIDsMap), startingColumnIDs);
    return {
      sheet_index: sheetIndex,
      column_ids: columnIDs,
      fill_method: finalFillMethod
    };
  };
  var getButtonMessage4 = (sheetData, columnIDs) => {
    if (columnIDs.length === 0) {
      return "Select columns to fill NaN values";
    }
    const columnHeaders = columnIDs.map((columnID) => sheetData == null ? void 0 : sheetData.columnIDsMap[columnID]).filter((columnHeader) => columnHeader !== void 0);
    const [columnHeadersString, numOtherColumnHeaders] = getFirstCharactersOfColumnHeaders(columnHeaders, 25);
    if (numOtherColumnHeaders === 0) {
      return `Fill NaNs in ${columnHeadersString}`;
    } else {
      return `Fill NaNs in ${columnHeadersString} and ${numOtherColumnHeaders} others`;
    }
  };
  var getSuccessMessage3 = (sheetData, columnIDs) => {
    const columnHeaders = columnIDs.map((columnID) => sheetData == null ? void 0 : sheetData.columnIDsMap[columnID]).filter((columnHeader) => columnHeader !== void 0);
    const [columnHeadersString, numOtherColumnHeaders] = getFirstCharactersOfColumnHeaders(columnHeaders, 25);
    if (numOtherColumnHeaders === 0) {
      return /* @__PURE__ */ import_react135.default.createElement("p", null, "Filled NaNs in ", /* @__PURE__ */ import_react135.default.createElement("span", { className: "text-color-gray-important" }, columnHeadersString), ".");
    } else {
      return /* @__PURE__ */ import_react135.default.createElement("p", null, "Filled NaNs in ", /* @__PURE__ */ import_react135.default.createElement("span", { className: "text-color-gray-important" }, columnHeadersString), " and ", /* @__PURE__ */ import_react135.default.createElement("span", { className: "text-color-gray-important" }, numOtherColumnHeaders), " other columns.");
    }
  };
  var FillNaTaskpane = (props) => {
    const { params, setParams, loading, edit, editApplied } = useSendEditOnClick_default(
      () => getDefaultParams4(props.sheetDataArray, props.selectedSheetIndex, void 0, props.startingColumnIDs),
      "fill_na" /* FillNa */,
      props.mitoAPI,
      props.analysisData
    );
    (0, import_react135.useEffect)(() => {
      setParams((prevParams) => {
        const newParams = getDefaultParams4(props.sheetDataArray, props.selectedSheetIndex, prevParams.fill_method, props.startingColumnIDs);
        if (newParams) {
          return newParams;
        }
        return prevParams;
      });
    }, [props.startingColumnIDs]);
    if (params === void 0) {
      return /* @__PURE__ */ import_react135.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState, message: "Import a dataset before filling NaN values." });
    }
    const sheetData = props.sheetDataArray[params.sheet_index];
    const columnDtypeMap = (sheetData == null ? void 0 : sheetData.columnDtypeMap) || {};
    const onlyMeanAndMedianColumnSelected = params.column_ids.length === 0 || params.column_ids.map((columnID) => columnDtypeMap[columnID]).filter((columnDtype) => columnDtype !== void 0).map((columnDtype) => isNumberDtype(columnDtype) || isDatetimeDtype(columnDtype) || isTimedeltaDtype(columnDtype)).every((hasDefinedMeanAndMedian) => hasDefinedMeanAndMedian === true);
    return /* @__PURE__ */ import_react135.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react135.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Fill NaN Values",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react135.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react135.default.createElement(
      DataframeSelect_default,
      {
        title: "Select the dataframe to fill nan values in.",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: params.sheet_index,
        onChange: (newSheetIndex) => {
          setParams((prevParams) => {
            const newParams = getDefaultParams4(props.sheetDataArray, newSheetIndex, prevParams.fill_method);
            if (newParams) {
              return newParams;
            }
            return __spreadProps(__spreadValues({}, prevParams), {
              sheet_index: newSheetIndex
            });
          });
        }
      }
    ), /* @__PURE__ */ import_react135.default.createElement(Spacer_default, { px: 15 }), /* @__PURE__ */ import_react135.default.createElement(Row_default, { justify: "space-between", align: "center", title: "Select the columns to fill nan values in." }, /* @__PURE__ */ import_react135.default.createElement(Col_default, null, /* @__PURE__ */ import_react135.default.createElement("p", { className: "text-header-3" }, "Columns to Fill NaN Values In"))), /* @__PURE__ */ import_react135.default.createElement(
      MultiToggleColumns_default,
      {
        sheetData,
        selectedColumnIDs: params.column_ids,
        getIsDisabledColumnID: (columnID, columnHeader, columnDtype) => {
          const disabled = (params.fill_method.type === "mean" || params.fill_method.type === "median") && !(isNumberDtype(columnDtype) || isTimedeltaDtype(columnDtype) || isDatetimeDtype(columnDtype));
          return disabled;
        },
        onChange: (newSelectedColumnIDs) => {
          setParams((oldDropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, oldDropDuplicateParams), {
              column_ids: newSelectedColumnIDs
            });
          });
        }
      }
    ), /* @__PURE__ */ import_react135.default.createElement(Spacer_default, { px: 15 }), /* @__PURE__ */ import_react135.default.createElement(Row_default, { justify: "space-between", align: "center", title: "Select the method for filling nan values" }, /* @__PURE__ */ import_react135.default.createElement(Col_default, null, /* @__PURE__ */ import_react135.default.createElement("p", { className: "text-header-3" }, "Fill Method")), /* @__PURE__ */ import_react135.default.createElement(Col_default, null, /* @__PURE__ */ import_react135.default.createElement(
      Select_default,
      {
        value: params.fill_method.type,
        onChange: (newFillMethodType) => {
          setParams((prevConcatParams) => {
            let newFillMethod = { type: "bfill" };
            if (newFillMethodType === "value") {
              newFillMethod = { type: "value", value: 0 };
            } else {
              newFillMethod = { type: newFillMethodType };
            }
            return __spreadProps(__spreadValues({}, prevConcatParams), {
              fill_method: newFillMethod
            });
          });
        },
        width: "medium"
      },
      /* @__PURE__ */ import_react135.default.createElement(
        DropdownItem_default,
        {
          id: "value",
          title: "Value",
          subtext: "Replaces NaN values with a specific value that you input."
        }
      ),
      /* @__PURE__ */ import_react135.default.createElement(
        DropdownItem_default,
        {
          id: "ffill",
          title: "Forward Fill",
          subtext: "Replaces NaNs in the column with the value in the row before."
        }
      ),
      /* @__PURE__ */ import_react135.default.createElement(
        DropdownItem_default,
        {
          id: "bfill",
          title: "Back Fill",
          subtext: "Replaces NaNs in the column with the value in the row after."
        }
      ),
      /* @__PURE__ */ import_react135.default.createElement(
        DropdownItem_default,
        {
          id: "mean",
          title: "Column Mean",
          subtext: !onlyMeanAndMedianColumnSelected ? "Only number, datetime, and timedetla columns support fill with mean." : "Replaces NaN values in number columns with the average of the column.",
          disabled: !onlyMeanAndMedianColumnSelected
        }
      ),
      /* @__PURE__ */ import_react135.default.createElement(
        DropdownItem_default,
        {
          id: "median",
          title: "Column Median",
          subtext: !onlyMeanAndMedianColumnSelected ? "Only number, datetime, and timedetla columns support fill with median." : "Replaces NaN values in number columns with the median of the column.",
          disabled: !onlyMeanAndMedianColumnSelected
        }
      )
    ))), params.fill_method.type === "value" && /* @__PURE__ */ import_react135.default.createElement(Row_default, { justify: "space-between", align: "center", title: "Select the dataframe to fill nan values in." }, /* @__PURE__ */ import_react135.default.createElement(Col_default, null, /* @__PURE__ */ import_react135.default.createElement("p", { className: "text-header-3" }, "Fill Value")), /* @__PURE__ */ import_react135.default.createElement(Col_default, null, /* @__PURE__ */ import_react135.default.createElement(
      Input_default,
      {
        autoFocus: true,
        width: "medium",
        value: "" + params.fill_method.value,
        onChange: (e) => {
          const newValue = e.target.value;
          setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              fill_method: {
                type: "value",
                value: newValue
              }
            });
          });
        }
      }
    ))), /* @__PURE__ */ import_react135.default.createElement(Spacer_default, { px: 10 + (params.fill_method.type === "value" ? 0 : 38) }), /* @__PURE__ */ import_react135.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          edit((prevParams) => {
            if (prevParams.fill_method.type === "value" && typeof prevParams.fill_method.value === "string") {
              let finalValue = prevParams.fill_method.value;
              if (BOOLEAN_STRINGS.includes(finalValue)) {
                finalValue = finalValue.toLowerCase().startsWith("t") ? true : false;
              } else if (isOnlyNumberString(prevParams.fill_method.value)) {
                finalValue = parseFloat(prevParams.fill_method.value);
              }
              return __spreadProps(__spreadValues({}, prevParams), {
                fill_method: { type: "value", value: finalValue }
              });
            }
            return prevParams;
          });
        },
        disabled: params.column_ids.length === 0,
        disabledTooltip: "Select at least one column to fill NaN values in"
      },
      getButtonMessage4(sheetData, params.column_ids)
    ), editApplied && !loading && /* @__PURE__ */ import_react135.default.createElement(Row_default, { className: "mt-5" }, /* @__PURE__ */ import_react135.default.createElement("p", { className: "text-subtext-1" }, getSuccessMessage3(sheetData, params.column_ids)))));
  };
  var FillNaTaskpane_default = FillNaTaskpane;

  // src/components/taskpanes/Graph/GraphSidebar.tsx
  var import_react142 = __toESM(require_react());

  // src/components/taskpanes/Graph/GraphSidebarTabs.tsx
  var import_react136 = __toESM(require_react());
  function GraphSidebarTabs(props) {
    const changeTab = (tab) => {
      props.setSelectedGraphSidebarTab(tab);
      void props.mitoAPI.log("clicked_graph_" + tab + "_tab");
    };
    return /* @__PURE__ */ import_react136.default.createElement("div", { className: "graph-sidebar-tab-container" }, /* @__PURE__ */ import_react136.default.createElement(
      "div",
      {
        className: classNames("control-panel-taskpane-tab", props.selectedTab === "setup" /* Setup */ ? "selected" : "unselected"),
        onClick: () => changeTab("setup" /* Setup */)
      },
      /* @__PURE__ */ import_react136.default.createElement("p", null, "Setup")
    ), /* @__PURE__ */ import_react136.default.createElement(
      "div",
      {
        className: classNames("control-panel-taskpane-tab", props.selectedTab === "style" /* Style */ ? "selected" : "unselected"),
        onClick: () => changeTab("style" /* Style */)
      },
      /* @__PURE__ */ import_react136.default.createElement("p", null, "Style")
    ), /* @__PURE__ */ import_react136.default.createElement(
      "div",
      {
        className: classNames("control-panel-taskpane-tab", props.selectedTab === "export" /* Export */ ? "selected" : "unselected"),
        onClick: () => changeTab("export" /* Export */)
      },
      /* @__PURE__ */ import_react136.default.createElement("p", null, "Export")
    ));
  }
  var GraphSidebarTabs_default = GraphSidebarTabs;

  // src/components/taskpanes/Graph/LoadingSpinner.tsx
  var import_react137 = __toESM(require_react());
  function LoadingSpinner() {
    const circles = [...Array(12)].map((_, index) => {
      return /* @__PURE__ */ import_react137.default.createElement("div", { key: index }, /* @__PURE__ */ import_react137.default.createElement("div", { className: "div-after", style: { background: "#7f58af" } }));
    });
    return /* @__PURE__ */ import_react137.default.createElement("div", { className: "lds-spinner" }, circles);
  }

  // src/components/taskpanes/Graph/GraphStyleTab.tsx
  var import_react138 = __toESM(require_react());
  function GraphStyleTab(props) {
    var _a;
    const graphCreationParams = props.graphParams.graphCreation;
    const graphStylingParams = props.graphParams.graphStyling;
    function updateGraphParam(update) {
      props.setGraphParams((prevGraphParams) => {
        return updateObjectWithPartialObject(prevGraphParams, update);
      });
      props.setGraphUpdatedNumber((old) => old + 1);
    }
    return /* @__PURE__ */ import_react138.default.createElement("div", { className: "graph-sidebar-toolbar-content" }, /* @__PURE__ */ import_react138.default.createElement(CollapsibleSection_default, { title: "Titles" }, /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Graph Title")), /* @__PURE__ */ import_react138.default.createElement(
      Input_default,
      {
        value: graphStylingParams.title.title || "",
        placeholder: "Default Graph Title",
        onChange: (e) => {
          const newTitle = e.target.value !== "" ? e.target.value : void 0;
          return updateGraphParam({ graphStyling: { title: { title: newTitle } } });
        }
      }
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "X Axis Title")), /* @__PURE__ */ import_react138.default.createElement(
      Input_default,
      {
        value: graphStylingParams.xaxis.title || "",
        placeholder: "Default X Axis",
        onChange: (e) => {
          const newTitle = e.target.value !== "" ? e.target.value : void 0;
          return updateGraphParam({ graphStyling: { xaxis: { title: newTitle } } });
        }
      }
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Y Axis Title")), /* @__PURE__ */ import_react138.default.createElement(
      Input_default,
      {
        value: graphStylingParams.yaxis.title || "",
        placeholder: "Default Y Axis",
        onChange: (e) => {
          const newTitle = e.target.value !== "" ? e.target.value : void 0;
          return updateGraphParam({ graphStyling: { yaxis: { title: newTitle } } });
        }
      }
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Display Title")), /* @__PURE__ */ import_react138.default.createElement(
      Toggle_default,
      {
        value: graphStylingParams.title.visible,
        onChange: () => {
          return updateGraphParam({ graphStyling: { title: { visible: !graphStylingParams.title.visible } } });
        }
      }
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Display X Axis Title")), /* @__PURE__ */ import_react138.default.createElement(
      Toggle_default,
      {
        value: graphStylingParams.xaxis.visible,
        onChange: () => {
          return updateGraphParam({ graphStyling: { xaxis: { visible: !graphStylingParams.xaxis.visible } } });
        }
      }
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Display Y Axis Title")), /* @__PURE__ */ import_react138.default.createElement(
      Toggle_default,
      {
        value: graphStylingParams.yaxis.visible,
        onChange: () => {
          return updateGraphParam({ graphStyling: { yaxis: { visible: !graphStylingParams.yaxis.visible } } });
        }
      }
    ))), /* @__PURE__ */ import_react138.default.createElement(CollapsibleSection_default, { title: "Axis Transformations" }, /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "X Axis Transform")), /* @__PURE__ */ import_react138.default.createElement(
      Select_default,
      {
        value: props.graphParams.graphStyling.xaxis.type || "default",
        onChange: (xAxisType) => {
          const newXAxisType = xAxisType !== "default" /* DEFAULT */ ? xAxisType : void 0;
          return updateGraphParam({ graphStyling: { xaxis: { type: newXAxisType } } });
        },
        width: "small",
        dropdownWidth: "medium"
      },
      /* @__PURE__ */ import_react138.default.createElement(
        DropdownItem_default,
        {
          title: "default" /* DEFAULT */
        }
      ),
      /* @__PURE__ */ import_react138.default.createElement(
        DropdownItem_default,
        {
          title: "linear" /* LINEAR */
        }
      ),
      /* @__PURE__ */ import_react138.default.createElement(
        DropdownItem_default,
        {
          title: "log" /* LOG */
        }
      ),
      /* @__PURE__ */ import_react138.default.createElement(
        DropdownItem_default,
        {
          title: "date" /* DATE */
        }
      ),
      /* @__PURE__ */ import_react138.default.createElement(
        DropdownItem_default,
        {
          title: "category" /* CATEGORY */
        }
      )
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Y Axis Transform")), /* @__PURE__ */ import_react138.default.createElement(
      Select_default,
      {
        value: props.graphParams.graphStyling.yaxis.type || "default",
        onChange: (yAxisType) => {
          const newYAxisType = yAxisType !== "default" /* DEFAULT */ ? yAxisType : void 0;
          return updateGraphParam({ graphStyling: { yaxis: { type: newYAxisType } } });
        },
        width: "small",
        dropdownWidth: "medium"
      },
      /* @__PURE__ */ import_react138.default.createElement(
        DropdownItem_default,
        {
          title: "default" /* DEFAULT */
        }
      ),
      /* @__PURE__ */ import_react138.default.createElement(
        DropdownItem_default,
        {
          title: "linear" /* LINEAR */
        }
      ),
      /* @__PURE__ */ import_react138.default.createElement(
        DropdownItem_default,
        {
          title: "log" /* LOG */
        }
      ),
      /* @__PURE__ */ import_react138.default.createElement(
        DropdownItem_default,
        {
          title: "date" /* DATE */
        }
      ),
      /* @__PURE__ */ import_react138.default.createElement(
        DropdownItem_default,
        {
          title: "category" /* CATEGORY */
        }
      )
    ))), /* @__PURE__ */ import_react138.default.createElement(CollapsibleSection_default, { title: "Legend", proSection: true, isPro: props.userProfile.isPro }, !props.userProfile.isPro && /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react138.default.createElement("p", { className: "text-body-1" }, "Want to customize the legend? ", /* @__PURE__ */ import_react138.default.createElement("a", { href: "https://trymito.io/plans", target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ import_react138.default.createElement("span", { className: "text-body-1-link" }, "Upgrade to Mito Pro.")))), props.userProfile.isPro && /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center", title: "Title of legend" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Display Legend")), /* @__PURE__ */ import_react138.default.createElement(
      Toggle_default,
      {
        value: graphStylingParams.showlegend,
        onChange: () => {
          return updateGraphParam({ graphStyling: { showlegend: !graphStylingParams.showlegend } });
        }
      }
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center", title: "Display the legend vertically or horizontally" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Orientation")), /* @__PURE__ */ import_react138.default.createElement(
      Select_default,
      {
        value: graphStylingParams.legend.orientation === "v" ? "vertical" : "horiztonal",
        width: "medium",
        onChange: (newOrientation) => {
          return updateGraphParam({ graphStyling: { legend: { orientation: newOrientation } } });
        }
      },
      /* @__PURE__ */ import_react138.default.createElement(DropdownItem_default, { title: "vertical", id: "v" }),
      /* @__PURE__ */ import_react138.default.createElement(DropdownItem_default, { title: "horizontal", id: "h" })
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center", title: "Title of legend" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Legend title")), /* @__PURE__ */ import_react138.default.createElement(
      Input_default,
      {
        value: ((_a = graphStylingParams.legend.title) == null ? void 0 : _a.text) ? graphStylingParams.legend.title.text : "",
        width: "medium",
        placeholder: "Legend title",
        onChange: (e) => {
          const newLegendTitle = e.target.value;
          return updateGraphParam({ graphStyling: { legend: { title: { text: newLegendTitle } } } });
        }
      }
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center", title: "The x position of the legend" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "X position (-2 to 3)")), /* @__PURE__ */ import_react138.default.createElement(
      Input_default,
      {
        value: graphStylingParams.legend.x ? graphStylingParams.legend.x.toString() : "",
        type: "number",
        width: "small",
        placeholder: graphStylingParams.legend.orientation === "v" ? "1.02" : "0.00",
        onChange: (e) => {
          const newX = e.target.value === "" ? void 0 : e.target.value;
          return updateGraphParam({ graphStyling: { legend: { x: newX } } });
        }
      }
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center", title: "The y position of the legend" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Y position (-2 to 3)")), /* @__PURE__ */ import_react138.default.createElement(
      Input_default,
      {
        value: graphStylingParams.legend.y ? graphStylingParams.legend.y.toString() : "",
        type: "number",
        width: "small",
        placeholder: graphStylingParams.legend.orientation === "v" ? "1.00" : graphStylingParams.xaxis.rangeslider.visible ? "1.10" : "-0.10",
        onChange: (e) => {
          const newY = e.target.value === "" ? void 0 : e.target.value;
          return updateGraphParam({ graphStyling: { legend: { y: newY } } });
        }
      }
    )))), /* @__PURE__ */ import_react138.default.createElement(CollapsibleSection_default, { title: "Grid Lines", proSection: true, isPro: props.userProfile.isPro }, !props.userProfile.isPro && /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react138.default.createElement("p", { className: "text-body-1" }, "Want to customize the grid lines? ", /* @__PURE__ */ import_react138.default.createElement("a", { href: "https://trymito.io/plans", target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ import_react138.default.createElement("span", { className: "text-body-1-link" }, "Upgrade to Mito Pro.")))), props.userProfile.isPro && /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center", title: "Turn on/off vertical grid lines" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Show vertical grid")), /* @__PURE__ */ import_react138.default.createElement(
      Toggle_default,
      {
        value: graphStylingParams.xaxis.showgrid,
        onChange: () => {
          return updateGraphParam({ graphStyling: { xaxis: { showgrid: !graphStylingParams.xaxis.showgrid } } });
        }
      }
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center", title: "Turn on/off horiztonal grid lines" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Show horizontal grid")), /* @__PURE__ */ import_react138.default.createElement(
      Toggle_default,
      {
        value: graphStylingParams.yaxis.showgrid,
        onChange: () => {
          return updateGraphParam({ graphStyling: { yaxis: { showgrid: !graphStylingParams.yaxis.showgrid } } });
        }
      }
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center", title: "The width of the vertical grid lines" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Vertical grid width")), /* @__PURE__ */ import_react138.default.createElement(
      Input_default,
      {
        value: graphStylingParams.xaxis.gridwidth ? graphStylingParams.xaxis.gridwidth.toString() : "",
        type: "number",
        width: "small",
        placeholder: "1",
        onChange: (e) => {
          const newVerticalGridWidth = e.target.value === "" ? void 0 : e.target.value;
          return updateGraphParam({ graphStyling: { xaxis: { gridwidth: newVerticalGridWidth } } });
        }
      }
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center", title: "The width of the horizontal grid lines" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Horizontal grid width")), /* @__PURE__ */ import_react138.default.createElement(
      Input_default,
      {
        value: graphStylingParams.yaxis.gridwidth ? graphStylingParams.yaxis.gridwidth.toString() : "",
        type: "number",
        width: "small",
        placeholder: "1",
        onChange: (e) => {
          const newHoriztonalGridWidth = e.target.value === "" ? void 0 : e.target.value;
          return updateGraphParam({ graphStyling: { yaxis: { gridwidth: newHoriztonalGridWidth } } });
        }
      }
    )))), /* @__PURE__ */ import_react138.default.createElement(CollapsibleSection_default, { title: "Colors", proSection: true, isPro: props.userProfile.isPro }, !props.userProfile.isPro && /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react138.default.createElement("p", { className: "text-body-1" }, "Want to set the colors of your graph? ", /* @__PURE__ */ import_react138.default.createElement("a", { href: "https://trymito.io/plans", target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ import_react138.default.createElement("span", { className: "text-body-1-link" }, "Upgrade to Mito Pro.")))), props.userProfile.isPro && /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(
      LabelAndColor_default,
      {
        label: "Plot Background Color",
        color: graphStylingParams.plot_bgcolor,
        onChange: (newColor) => {
          return updateGraphParam({ graphStyling: { plot_bgcolor: newColor } });
        }
      }
    ), /* @__PURE__ */ import_react138.default.createElement(
      LabelAndColor_default,
      {
        label: "Paper Background Color",
        color: graphStylingParams.paper_bgcolor,
        onChange: (newColor) => {
          return updateGraphParam({ graphStyling: { paper_bgcolor: newColor } });
        }
      }
    ), /* @__PURE__ */ import_react138.default.createElement(
      LabelAndColor_default,
      {
        label: "Title color",
        color: graphStylingParams.title.title_font_color,
        onChange: (newColor) => {
          return updateGraphParam({ graphStyling: { title: { title_font_color: newColor } } });
        }
      }
    ), /* @__PURE__ */ import_react138.default.createElement(
      LabelAndColor_default,
      {
        label: "X axis title color",
        color: graphStylingParams.xaxis.title_font_color,
        onChange: (newColor) => {
          return updateGraphParam({ graphStyling: { xaxis: { title_font_color: newColor } } });
        }
      }
    ), /* @__PURE__ */ import_react138.default.createElement(
      LabelAndColor_default,
      {
        label: "Y axis title color",
        color: graphStylingParams.yaxis.title_font_color,
        onChange: (newColor) => {
          return updateGraphParam({ graphStyling: { yaxis: { title_font_color: newColor } } });
        }
      }
    ))), /* @__PURE__ */ import_react138.default.createElement(CollapsibleSection_default, { title: "Facet Styling", proSection: true, isPro: props.userProfile.isPro }, !props.userProfile.isPro && /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react138.default.createElement("p", { className: "text-body-1" }, "Want to style facet plots? ", /* @__PURE__ */ import_react138.default.createElement("a", { href: "https://trymito.io/plans", target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ import_react138.default.createElement("span", { className: "text-body-1-link" }, "Upgrade to Mito Pro.")))), props.userProfile.isPro && /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center", title: "The number of plots to display per row. Has no effect when facet row is used." }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Number of cols (int)")), /* @__PURE__ */ import_react138.default.createElement(
      Input_default,
      {
        value: graphCreationParams.facet_col_wrap ? graphCreationParams.facet_col_wrap.toString() : "",
        type: "number",
        width: "small",
        placeholder: "num cols",
        onChange: (e) => {
          const newNumCols = e.target.value === "" ? void 0 : e.target.value;
          return updateGraphParam({ graphCreation: { facet_col_wrap: newNumCols } });
        }
      }
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center", title: "The spacing between columns of facet plots. Set as a fraction of plotting area." }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Column spacing (0 to 1)")), /* @__PURE__ */ import_react138.default.createElement(
      Input_default,
      {
        value: graphCreationParams.facet_col_spacing ? graphCreationParams.facet_col_spacing.toString() : "",
        type: "number",
        width: "small",
        placeholder: ".03",
        onChange: (e) => {
          const newColSpacing = e.target.value === "" ? void 0 : e.target.value;
          return updateGraphParam({ graphCreation: { facet_col_spacing: newColSpacing } });
        }
      }
    )), /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center", title: "The spacing between rows of facet plots. Set as a fraction of plotting area." }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Row spacing (0 to 1)")), /* @__PURE__ */ import_react138.default.createElement(
      Input_default,
      {
        value: graphCreationParams.facet_row_spacing ? graphCreationParams.facet_row_spacing.toString() : "",
        type: "number",
        width: "small",
        placeholder: ".07",
        onChange: (e) => {
          const newRowSpacing = e.target.value === "" ? void 0 : e.target.value;
          return updateGraphParam({ graphCreation: { facet_row_spacing: newRowSpacing } });
        }
      }
    )))), /* @__PURE__ */ import_react138.default.createElement(CollapsibleSection_default, { title: "Range slider" }, /* @__PURE__ */ import_react138.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react138.default.createElement(Col_default, null, /* @__PURE__ */ import_react138.default.createElement("p", null, "Display range slider")), /* @__PURE__ */ import_react138.default.createElement(
      Toggle_default,
      {
        value: graphStylingParams.xaxis.rangeslider.visible,
        onChange: () => {
          return updateGraphParam(
            { graphStyling: { xaxis: { rangeslider: { visible: !graphStylingParams.xaxis.rangeslider.visible } } } }
          );
        }
      }
    ))));
  }
  var GraphStyleTab_default = GraphStyleTab;

  // src/components/taskpanes/Graph/GraphExportTab.tsx
  var import_react140 = __toESM(require_react());

  // src/hooks/useCopyToClipboard.tsx
  var import_react139 = __toESM(require_react());
  var useCopyToClipboard = (text, resetTimeout = 2500) => {
    const [copyStatus, setCopyStatus] = (0, import_react139.useState)(false);
    const copy = (0, import_react139.useCallback)(() => {
      if (text == void 0) {
        return;
      }
      writeTextToClipboard(text).then(
        () => {
          setCopyStatus(true);
        },
        () => {
          setCopyStatus(false);
        }
      );
    }, [text]);
    (0, import_react139.useEffect)(() => {
      if (!copyStatus) {
        return;
      }
      const timer = setTimeout(() => {
        setCopyStatus(false);
      }, resetTimeout);
      return () => clearTimeout(timer);
    }, [copyStatus]);
    return [copy, copyStatus];
  };

  // src/components/taskpanes/Graph/GraphExportTab.tsx
  function GraphExportTab(props) {
    var _a, _b;
    const [_copyShowGraphCode, showGraphCodeCopied] = useCopyToClipboard(
      (((_a = props.graphOutput) == null ? void 0 : _a.graphGeneratedCode) || "") + `
fig.show(renderer="iframe")`
    );
    const [_copyExportHTMLGraphCode, exportHTMLGraphCodeCopied] = useCopyToClipboard(
      (((_b = props.graphOutput) == null ? void 0 : _b.graphGeneratedCode) || "") + `
fig.write_html("${props.graphTabName}.html")`
    );
    const copyShowGraphCode = () => {
      _copyShowGraphCode();
      void props.mitoAPI.log("copy_graph_code", {
        "graph_type": props.graphParams.graphCreation.graph_type
      });
    };
    const copyExportHTMLGraphCode = () => {
      _copyExportHTMLGraphCode();
      void props.mitoAPI.log("copy_export_html_graph_code", {
        "graph_type": props.graphParams.graphCreation.graph_type
      });
    };
    return /* @__PURE__ */ import_react140.default.createElement("div", { className: "graph-sidebar-toolbar-content" }, /* @__PURE__ */ import_react140.default.createElement("div", null, /* @__PURE__ */ import_react140.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        onClick: copyShowGraphCode,
        disabled: props.loading || props.graphOutput === void 0,
        tooltip: "Click to copy code that creates graph and displays it in the notebook"
      },
      !showGraphCodeCopied ? "Copy code that displays graph" : "Copied to Clipboard!"
    ), showGraphCodeCopied ? /* @__PURE__ */ import_react140.default.createElement(Row_default, { justify: "center", className: "text-subtext-1" }, "Paste copied code in code cell below") : /* @__PURE__ */ import_react140.default.createElement(import_react140.default.Fragment, null)), /* @__PURE__ */ import_react140.default.createElement("div", null, /* @__PURE__ */ import_react140.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        onClick: copyExportHTMLGraphCode,
        disabled: props.loading || props.graphOutput === void 0,
        tooltip: "Click to copy code that creates graph and exports it as an html file"
      },
      !exportHTMLGraphCodeCopied ? "Copy code to create graph HTML file" : "Copied to Clipboard!"
    ), exportHTMLGraphCodeCopied ? /* @__PURE__ */ import_react140.default.createElement(Row_default, { justify: "center", className: "text-subtext-1" }, "Paste copied code in code cell below") : /* @__PURE__ */ import_react140.default.createElement(import_react140.default.Fragment, null)), /* @__PURE__ */ import_react140.default.createElement("div", null, /* @__PURE__ */ import_react140.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        onClick: () => {
          var _a2;
          const downloadLink = (_a2 = props.mitoContainerRef.current) == null ? void 0 : _a2.querySelector('[data-title="Download plot as a png"]');
          downloadLink == null ? void 0 : downloadLink.click();
        },
        disabled: props.loading || props.graphOutput === void 0,
        tooltip: "Click to download graph as png"
      },
      "Download as PNG"
    )));
  }
  var GraphExportTab_default = GraphExportTab;

  // src/hooks/useEffectOnElementResize.tsx
  var import_react141 = __toESM(require_react());
  var useEffectOnResizeElement = (effect, deps, id) => {
    (0, import_react141.useEffect)(() => {
      const resizeObserver = new ResizeObserver(() => {
        effect();
      });
      const element = document.getElementById(id);
      if (element) {
        resizeObserver.observe(element);
      }
      return () => {
        resizeObserver.disconnect();
      };
    }, [...deps, id]);
  };

  // src/components/taskpanes/Graph/GraphSidebar.tsx
  var LOAD_GRAPH_TIMEOUT = 1e3;
  var GraphSidebar = (props) => {
    var _a, _b, _c;
    const graphID = props.graphID;
    const [stepID, setStepID] = (0, import_react142.useState)(void 0);
    const [graphParams, setGraphParams] = (0, import_react142.useState)(() => getGraphParams(props.graphDataDict, graphID, props.uiState.selectedSheetIndex, props.sheetDataArray));
    const dataSourceSheetIndex = graphParams.graphCreation.sheet_index;
    const graphOutput = (_a = props.graphDataDict[graphID]) == null ? void 0 : _a.graphOutput;
    const graphTabName = (_b = props.graphDataDict[graphID]) == null ? void 0 : _b.graphTabName;
    const [loading, setLoading] = (0, import_react142.useState)(false);
    const [selectedGraphSidebarTab, setSelectedGraphSidebarTab] = (0, import_react142.useState)("setup" /* Setup */);
    (0, import_react142.useEffect)(() => {
      if (props.graphSidebarTab === "export" /* Export */) {
        setSelectedGraphSidebarTab(props.graphSidebarTab);
      }
    }, [props.graphSidebarTab]);
    const [graphUpdatedNumber, setGraphUpdatedNumber] = (0, import_react142.useState)(0);
    (0, import_react142.useEffect)(() => {
      if (!window.Plotly) {
        void props.mitoAPI.log("plotly_define_failed");
      }
    }, []);
    useEffectOnResizeElement(() => {
      setGraphUpdatedNumber((old) => old + 1);
    }, [], "mito-main-sheet-div");
    useEffectOnUpdateEvent(() => {
      void refreshParams();
    }, props.analysisData);
    (0, import_react142.useEffect)(() => {
      setStepID(void 0);
      setGraphParams(getGraphParams(props.graphDataDict, props.graphID, props.uiState.selectedSheetIndex, props.sheetDataArray));
      setGraphUpdatedNumber((old) => old + 1);
    }, [props.graphID]);
    useDebouncedEffect(() => {
      setLoading(true);
      void getGraphAsync();
    }, [graphUpdatedNumber], LOAD_GRAPH_TIMEOUT);
    (0, import_react142.useEffect)(() => {
      try {
        if (graphOutput === void 0) {
          return;
        }
        const executeScript = new Function(graphOutput.graphScript);
        executeScript();
      } catch (e) {
        console.error("Failed to execute graph function", e);
      }
    }, [graphOutput]);
    const getGraphAsync = async () => {
      var _a2;
      const boundingRect = (_a2 = document.getElementById("mito-main-sheet-div")) == null ? void 0 : _a2.getBoundingClientRect();
      if (boundingRect !== void 0) {
        const _stepID = await props.mitoAPI.editGraph(
          graphID,
          graphParams,
          `${(boundingRect == null ? void 0 : boundingRect.height) - 10}px`,
          `${(boundingRect == null ? void 0 : boundingRect.width) - 20 - 300}px`,
          stepID
        );
        setStepID(_stepID);
      }
      setLoading(false);
    };
    const refreshParams = async () => {
      const newGraphParams = getGraphParams(props.graphDataDict, graphID, dataSourceSheetIndex, props.sheetDataArray);
      setGraphParams(newGraphParams);
    };
    if (props.sheetDataArray.length === 0) {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: { type: "none" /* NONE */ }
        });
      });
      return /* @__PURE__ */ import_react142.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    } else {
      return /* @__PURE__ */ import_react142.default.createElement("div", { className: "graph-sidebar-div" }, /* @__PURE__ */ import_react142.default.createElement(
        "div",
        {
          className: "graph-sidebar-graph-div",
          id: "graph-div",
          style: {
            backgroundColor: graphParams.graphStyling.paper_bgcolor
          }
        },
        graphOutput === void 0 && /* @__PURE__ */ import_react142.default.createElement("p", { className: "graph-sidebar-welcome-text text-align-center-important" }, "To generate a graph, select an axis."),
        graphOutput !== void 0 && /* @__PURE__ */ import_react142.default.createElement("div", { dangerouslySetInnerHTML: { __html: graphOutput.graphHTML } })
      ), /* @__PURE__ */ import_react142.default.createElement("div", { className: "graph-sidebar-toolbar-container" }, /* @__PURE__ */ import_react142.default.createElement("div", { className: "graph-sidebar-toolbar-content-container" }, /* @__PURE__ */ import_react142.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react142.default.createElement(Col_default, null, /* @__PURE__ */ import_react142.default.createElement("p", { className: "text-header-2" }, selectedGraphSidebarTab === "setup" /* Setup */ && "Setup Graph", selectedGraphSidebarTab === "style" /* Style */ && "Style Graph", selectedGraphSidebarTab === "export" /* Export */ && "Export Graph")), /* @__PURE__ */ import_react142.default.createElement(Col_default, null, /* @__PURE__ */ import_react142.default.createElement(
        XIcon_default,
        {
          onClick: () => {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                selectedTabType: "data",
                currOpenTaskpane: { type: "none" /* NONE */ }
              });
            });
          }
        }
      ))), selectedGraphSidebarTab === "setup" /* Setup */ && /* @__PURE__ */ import_react142.default.createElement(
        GraphSetupTab_default,
        {
          graphParams,
          setGraphParams,
          setGraphUpdatedNumber,
          uiState: props.uiState,
          mitoAPI: props.mitoAPI,
          sheetDataArray: props.sheetDataArray,
          dfNames: props.dfNames,
          columnDtypesMap: ((_c = props.sheetDataArray[dataSourceSheetIndex]) == null ? void 0 : _c.columnDtypeMap) || {},
          columnIDsMapArray: props.columnIDsMapArray,
          setUIState: props.setUIState
        }
      ), selectedGraphSidebarTab === "style" /* Style */ && /* @__PURE__ */ import_react142.default.createElement(
        GraphStyleTab_default,
        {
          graphParams,
          setGraphParams,
          setGraphUpdatedNumber,
          userProfile: props.userProfile
        }
      ), selectedGraphSidebarTab === "export" /* Export */ && /* @__PURE__ */ import_react142.default.createElement(
        GraphExportTab_default,
        {
          graphTabName,
          graphParams,
          mitoAPI: props.mitoAPI,
          loading,
          graphOutput,
          mitoContainerRef: props.mitoContainerRef
        }
      )), /* @__PURE__ */ import_react142.default.createElement(
        GraphSidebarTabs_default,
        {
          selectedTab: selectedGraphSidebarTab,
          setSelectedGraphSidebarTab,
          mitoAPI: props.mitoAPI
        }
      )), loading && /* @__PURE__ */ import_react142.default.createElement("div", { className: "popup-div" }, /* @__PURE__ */ import_react142.default.createElement(LoadingSpinner, null), /* @__PURE__ */ import_react142.default.createElement("p", { className: "popup-text-div" }, "loading")));
    }
  };
  var GraphSidebar_default = GraphSidebar;

  // src/components/taskpanes/Melt/MeltTaskpane.tsx
  var import_react143 = __toESM(require_react());
  var getDefaultParams5 = (sheetDataArray2, sheetIndex) => {
    if (sheetDataArray2.length === 0 || sheetDataArray2[sheetIndex] === void 0) {
      return void 0;
    }
    return {
      sheet_index: sheetIndex,
      id_var_column_ids: [],
      value_var_column_ids: Object.keys(sheetDataArray2[sheetIndex].columnDtypeMap || {})
    };
  };
  var MeltTaskpane = (props) => {
    const { params, setParams } = useLiveUpdatingParams_default(
      () => getDefaultParams5(props.sheetDataArray, props.selectedSheetIndex),
      "melt" /* Melt */,
      props.mitoAPI,
      props.analysisData,
      50
    );
    if (params === void 0) {
      return /* @__PURE__ */ import_react143.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    const sheetData = props.sheetDataArray[params.sheet_index];
    return /* @__PURE__ */ import_react143.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react143.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Unpivot Dataframe",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react143.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react143.default.createElement(
      DataframeSelect_default,
      {
        title: "Select a dataframe to unpivot.",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: params.sheet_index,
        onChange: (newSheetIndex) => {
          setParams((prevParams) => {
            const newParams = getDefaultParams5(props.sheetDataArray, newSheetIndex);
            if (newParams) {
              return newParams;
            }
            return __spreadProps(__spreadValues({}, prevParams), {
              sheet_index: newSheetIndex
            });
          });
        }
      }
    ), /* @__PURE__ */ import_react143.default.createElement(Row_default, { justify: "start", align: "center", title: "Column to use as identifier variables." }, /* @__PURE__ */ import_react143.default.createElement(LabelAndTooltip_default, { tooltip: "Column to use as identifier variables. These columns will be present in the unpivoted dataframe." }, "ID Variables")), /* @__PURE__ */ import_react143.default.createElement(
      MultiToggleColumns_default,
      {
        sheetData,
        selectedColumnIDs: params.id_var_column_ids,
        onChange: (newSelectedColumnIDs) => {
          setParams((oldDropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, oldDropDuplicateParams), {
              id_var_column_ids: newSelectedColumnIDs
            });
          });
        }
      }
    ), /* @__PURE__ */ import_react143.default.createElement(Spacer_default, { px: 10 }), /* @__PURE__ */ import_react143.default.createElement(Row_default, { justify: "start", align: "center", title: "Columns to unpivot." }, /* @__PURE__ */ import_react143.default.createElement(LabelAndTooltip_default, { tooltip: "Column to unpivot. Each column header will go in the variables column, and the column values will go in the values column." }, "Values")), /* @__PURE__ */ import_react143.default.createElement(
      MultiToggleColumns_default,
      {
        sheetData,
        selectedColumnIDs: params.value_var_column_ids.filter((cid) => !params.id_var_column_ids.includes(cid)),
        disabledColumnIDs: params.id_var_column_ids,
        onChange: (newSelectedColumnIDs) => {
          setParams((oldDropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, oldDropDuplicateParams), {
              value_var_column_ids: newSelectedColumnIDs
            });
          });
        }
      }
    )));
  };
  var MeltTaskpane_default = MeltTaskpane;

  // src/components/taskpanes/Merge/MergeTaskpane.tsx
  var import_react146 = __toESM(require_react());

  // src/components/taskpanes/Merge/MergeKeysSelection.tsx
  var import_react144 = __toESM(require_react());

  // src/components/taskpanes/Merge/mergeUtils.ts
  var getFirstSuggestedMergeKeys = (sheetDataArray2, sheetOneIndex, sheetTwoIndex, existingMergeKeys) => {
    var _a, _b;
    const sheetOneEntries = Object.entries(((_a = sheetDataArray2[sheetOneIndex]) == null ? void 0 : _a.columnIDsMap) || {});
    const sheetTwoEntries = Object.entries(((_b = sheetDataArray2[sheetTwoIndex]) == null ? void 0 : _b.columnIDsMap) || {});
    const columnIDsWithSharedColumnHeaders = sheetOneEntries.map(([columnID, columnHeader]) => {
      const matchingIndex = sheetTwoEntries.findIndex(([, otherColumnHeader]) => {
        return getDisplayColumnHeader(columnHeader) === getDisplayColumnHeader(otherColumnHeader);
      });
      if (matchingIndex > -1) {
        return [columnID, sheetTwoEntries[matchingIndex][0]];
      } else {
        return void 0;
      }
    });
    const allSuggestions = columnIDsWithSharedColumnHeaders.filter((cid) => cid !== void 0);
    if (allSuggestions.length === 0) {
      if (sheetOneEntries[0] === void 0 || sheetTwoEntries[0] === void 0) {
        return void 0;
      }
      return [sheetOneEntries[0][0], sheetTwoEntries[0][0]];
    } else {
      if (!existingMergeKeys) {
        return allSuggestions[0];
      } else {
        const notIncludedSuggestions = allSuggestions.filter(([columnIDOne, columnIDTwo]) => {
          const columnIDOneUsed = existingMergeKeys.findIndex(([mergeKeyOne]) => {
            return columnIDOne === mergeKeyOne;
          }) !== -1;
          const columnIDTwoUsed = existingMergeKeys.findIndex(([, mergeKeyTwo]) => {
            return columnIDTwo === mergeKeyTwo;
          }) !== -1;
          return !columnIDOneUsed && !columnIDTwoUsed;
        });
        if (notIncludedSuggestions.length === 0) {
          return allSuggestions[0];
        } else {
          return notIncludedSuggestions[0];
        }
      }
    }
  };

  // src/components/taskpanes/Merge/MergeKeysSelection.tsx
  var MergeKeysSelectionSection = (props) => {
    const sheetDataOne = props.sheetDataArray[props.params.sheet_index_one];
    const sheetDataTwo = props.sheetDataArray[props.params.sheet_index_two];
    const noPossibleMergeKeys = Object.keys((sheetDataOne == null ? void 0 : sheetDataOne.columnDtypeMap) || {}).length === 0 || Object.keys((sheetDataTwo == null ? void 0 : sheetDataTwo.columnDtypeMap) || {}).length === 0;
    return /* @__PURE__ */ import_react144.default.createElement("div", { className: "light-gray-container" }, /* @__PURE__ */ import_react144.default.createElement(Row_default, { suppressTopBottomMargin: true }, /* @__PURE__ */ import_react144.default.createElement(Col_default, null, /* @__PURE__ */ import_react144.default.createElement("p", { className: "text-header-3" }, "Match rows where:"))), props.params.merge_key_column_ids.map(([mergeKeyColumnIDOne, mergeKeyColumnIDTwo], index) => {
      return /* @__PURE__ */ import_react144.default.createElement(Row_default, { key: index, justify: "space-between", align: "center" }, /* @__PURE__ */ import_react144.default.createElement(Col_default, null, /* @__PURE__ */ import_react144.default.createElement(
        Select_default,
        {
          value: mergeKeyColumnIDOne,
          onChange: (columnID) => {
            props.setParams((prevParams) => {
              const newMergeKeys = [...prevParams.merge_key_column_ids];
              newMergeKeys[index][0] = columnID;
              return __spreadProps(__spreadValues({}, prevParams), {
                merge_key_column_ids: newMergeKeys
              });
            });
          },
          width: "medium",
          searchable: true
        },
        Object.entries((sheetDataOne == null ? void 0 : sheetDataOne.columnIDsMap) || {}).map(([columnID, columnHeader]) => {
          return /* @__PURE__ */ import_react144.default.createElement(
            DropdownItem_default,
            {
              key: columnID,
              id: columnID,
              title: getDisplayColumnHeader(columnHeader)
            }
          );
        })
      )), /* @__PURE__ */ import_react144.default.createElement(Col_default, { className: "text-header-3" }, "="), /* @__PURE__ */ import_react144.default.createElement(Col_default, null, /* @__PURE__ */ import_react144.default.createElement(
        Select_default,
        {
          value: mergeKeyColumnIDTwo,
          onChange: (columnID) => {
            props.setParams((prevParams) => {
              const newMergeKeys = [...prevParams.merge_key_column_ids];
              newMergeKeys[index][1] = columnID;
              return __spreadProps(__spreadValues({}, prevParams), {
                merge_key_column_ids: newMergeKeys
              });
            });
          },
          width: "medium",
          searchable: true
        },
        Object.entries((sheetDataTwo == null ? void 0 : sheetDataTwo.columnIDsMap) || {}).map(([columnID, columnHeader]) => {
          return /* @__PURE__ */ import_react144.default.createElement(
            DropdownItem_default,
            {
              key: columnID,
              id: columnID,
              title: getDisplayColumnHeader(columnHeader)
            }
          );
        })
      )), /* @__PURE__ */ import_react144.default.createElement(Col_default, null, /* @__PURE__ */ import_react144.default.createElement(
        XIcon_default,
        {
          onClick: () => {
            props.setParams((prevParams) => {
              const newMergeKeys = [...prevParams.merge_key_column_ids];
              newMergeKeys.splice(index, 1);
              return __spreadProps(__spreadValues({}, prevParams), {
                merge_key_column_ids: newMergeKeys
              });
            });
          }
        }
      )));
    }), props.error !== void 0 && /* @__PURE__ */ import_react144.default.createElement("p", { className: "text-color-error" }, props.error), /* @__PURE__ */ import_react144.default.createElement(Spacer_default, { px: 15 }), /* @__PURE__ */ import_react144.default.createElement(
      TextButton_default,
      {
        width: "medium",
        variant: "dark",
        onClick: () => {
          props.setParams((prevParams) => {
            const newMergeKeys = [...prevParams.merge_key_column_ids];
            const newSuggestedMergeKeys = getFirstSuggestedMergeKeys(props.sheetDataArray, props.params.sheet_index_one, props.params.sheet_index_two, props.params.merge_key_column_ids);
            if (newSuggestedMergeKeys) {
              newMergeKeys.push(newSuggestedMergeKeys);
            }
            return __spreadProps(__spreadValues({}, prevParams), {
              merge_key_column_ids: newMergeKeys
            });
          });
        },
        disabled: noPossibleMergeKeys,
        disabledTooltip: "One of these dataframes has no columns, so no merge keys can be added."
      },
      "+ Add Merge Keys"
    ));
  };
  var MergeKeysSelection_default = MergeKeysSelectionSection;

  // src/components/taskpanes/Merge/MergeSheetSelection.tsx
  var import_react145 = __toESM(require_react());
  var MergeSheetSection = (props) => {
    const [dfNames] = (0, import_react145.useState)(props.sheetDataArray.map((sheetData) => sheetData.dfName));
    return /* @__PURE__ */ import_react145.default.createElement("div", null, /* @__PURE__ */ import_react145.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react145.default.createElement(Col_default, null, /* @__PURE__ */ import_react145.default.createElement("p", { className: "text-header-3" }, "First Dataframe"), /* @__PURE__ */ import_react145.default.createElement(
      Select_default,
      {
        value: dfNames[props.params.sheet_index_one] || "",
        onChange: (dfName) => {
          const newSheetIndex = dfNames.indexOf(dfName);
          props.setParams((prevParams) => {
            const newParams = getDefaultMergeParams(props.sheetDataArray, newSheetIndex, prevParams.sheet_index_two, prevParams);
            return newParams ? newParams : prevParams;
          });
        },
        className: "merge-sheet-selection-first-dataframe-select"
      },
      dfNames.map((dfName) => {
        return /* @__PURE__ */ import_react145.default.createElement(
          DropdownItem_default,
          {
            key: dfName,
            title: dfName
          }
        );
      })
    )), /* @__PURE__ */ import_react145.default.createElement(Col_default, { offsetRight: 2 }, /* @__PURE__ */ import_react145.default.createElement("p", { className: "text-header-3" }, "Second Dataframe"), /* @__PURE__ */ import_react145.default.createElement(
      Select_default,
      {
        value: dfNames[props.params.sheet_index_two] || "",
        onChange: (dfName) => {
          const newSheetIndex = dfNames.indexOf(dfName);
          props.setParams((prevParams) => {
            const newParams = getDefaultMergeParams(props.sheetDataArray, prevParams.sheet_index_one, newSheetIndex, prevParams);
            return newParams ? newParams : prevParams;
          });
        },
        width: "medium"
      },
      dfNames.map((dfName) => {
        return /* @__PURE__ */ import_react145.default.createElement(
          DropdownItem_default,
          {
            key: dfName,
            title: dfName
          }
        );
      })
    ))));
  };
  var MergeSheetSelection_default = MergeSheetSection;

  // src/components/taskpanes/Merge/MergeTaskpane.tsx
  var getDefaultMergeParams = (sheetDataArray2, _sheetIndexOne, _sheetIndexTwo, previousParams) => {
    var _a, _b;
    if (sheetDataArray2.length < 2) {
      return void 0;
    }
    const sheetIndexOne = _sheetIndexOne;
    const sheetIndexTwo = _sheetIndexTwo !== void 0 ? _sheetIndexTwo : sheetIndexOne + 1 <= sheetDataArray2.length - 1 ? sheetIndexOne + 1 : sheetIndexOne - 1 >= 0 ? sheetIndexOne - 1 : sheetIndexOne;
    if (previousParams && previousParams.sheet_index_one == sheetIndexOne && previousParams.sheet_index_two === sheetIndexTwo) {
      return previousParams;
    }
    const suggestedMergeKeys = getFirstSuggestedMergeKeys(sheetDataArray2, sheetIndexOne, sheetIndexTwo);
    let selectedColumnIDsOne = [];
    let selectedColumnIDsTwo = [];
    if (previousParams && previousParams.sheet_index_one == sheetIndexOne) {
      selectedColumnIDsOne = previousParams.selected_column_ids_one;
    } else {
      selectedColumnIDsOne = [...Object.keys(((_a = sheetDataArray2[sheetIndexOne]) == null ? void 0 : _a.columnIDsMap) || {})];
    }
    if (previousParams && previousParams.sheet_index_two == sheetIndexTwo) {
      selectedColumnIDsTwo = previousParams.selected_column_ids_two;
    } else {
      selectedColumnIDsTwo = [...Object.keys(((_b = sheetDataArray2[sheetIndexTwo]) == null ? void 0 : _b.columnIDsMap) || {})];
    }
    return {
      how: previousParams ? previousParams.how : "lookup",
      sheet_index_one: sheetIndexOne,
      sheet_index_two: sheetIndexTwo,
      merge_key_column_ids: suggestedMergeKeys ? [suggestedMergeKeys] : [],
      selected_column_ids_one: selectedColumnIDsOne,
      selected_column_ids_two: selectedColumnIDsTwo
    };
  };
  var MergeTaskpane = (props) => {
    const { params, setParams, error } = useLiveUpdatingParams_default(
      () => getDefaultMergeParams(props.sheetDataArray, props.selectedSheetIndex),
      "merge" /* Merge */,
      props.mitoAPI,
      props.analysisData,
      50
    );
    if (params === void 0) {
      return /* @__PURE__ */ import_react146.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState, message: "You need two dataframes before you can merge them." });
    }
    const sheetDataOne = props.sheetDataArray[params.sheet_index_one];
    const sheetDataTwo = props.sheetDataArray[params.sheet_index_two];
    const mergeKeyColumnIDsOne = params.merge_key_column_ids.map(([one]) => {
      return one;
    });
    const mergeKeyColumnIDsTwo = params.merge_key_column_ids.map(([, two]) => {
      return two;
    });
    return /* @__PURE__ */ import_react146.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react146.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Merge Dataframes",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react146.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react146.default.createElement(Row_default, { justify: "space-between", align: "center", suppressTopBottomMargin: true }, /* @__PURE__ */ import_react146.default.createElement(Col_default, { offsetRight: 1 }, /* @__PURE__ */ import_react146.default.createElement("p", { className: "text-header-3" }, "Merge Type")), /* @__PURE__ */ import_react146.default.createElement(Col_default, { offsetRight: 2 }, /* @__PURE__ */ import_react146.default.createElement(
      Select_default,
      {
        value: params.how,
        onChange: (mergeType) => {
          const newMergeTypeEnum = mergeType;
          setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              how: newMergeTypeEnum
            });
          });
        },
        width: "medium-large"
      },
      /* @__PURE__ */ import_react146.default.createElement(
        DropdownItem_default,
        {
          title: "lookup" /* LOOKUP */,
          subtext: "Includes all rows from the first sheet and only matching rows from the second sheet. If there are mulitple matches in the second sheet, only takes the first."
        }
      ),
      /* @__PURE__ */ import_react146.default.createElement(
        DropdownItem_default,
        {
          title: "left" /* LEFT */,
          subtext: "Includes all rows from the first sheet and only matching rows from the second sheet. Includes all matches."
        }
      ),
      /* @__PURE__ */ import_react146.default.createElement(
        DropdownItem_default,
        {
          title: "right" /* RIGHT */,
          subtext: "Includes all rows from the second sheet and only matching rows from the  first sheet. Includes all matches."
        }
      ),
      /* @__PURE__ */ import_react146.default.createElement(
        DropdownItem_default,
        {
          title: "inner" /* INNER */,
          subtext: "Only includes rows that have matches in both sheets."
        }
      ),
      /* @__PURE__ */ import_react146.default.createElement(
        DropdownItem_default,
        {
          title: "outer" /* OUTER */,
          subtext: "Includes all rows from both sheets, regardless of whether there is a match in the other sheet."
        }
      ),
      /* @__PURE__ */ import_react146.default.createElement(
        DropdownItem_default,
        {
          title: "unique in left" /* UNIQUE_IN_LEFT */,
          subtext: "Includes each row from the first sheet that doesn't have a match in the second sheet."
        }
      ),
      /* @__PURE__ */ import_react146.default.createElement(
        DropdownItem_default,
        {
          title: "unique in right" /* UNIQUE_IN_RIGHT */,
          subtext: "Includes each row from second sheet that doesn't have a match in the first sheet."
        }
      )
    ))), /* @__PURE__ */ import_react146.default.createElement(Spacer_default, { px: 20 }), /* @__PURE__ */ import_react146.default.createElement(
      MergeSheetSelection_default,
      {
        params,
        setParams,
        sheetDataArray: props.sheetDataArray
      }
    ), /* @__PURE__ */ import_react146.default.createElement(Spacer_default, { px: 20 }), /* @__PURE__ */ import_react146.default.createElement(
      MergeKeysSelection_default,
      {
        params,
        setParams,
        sheetDataArray: props.sheetDataArray,
        error
      }
    ), /* @__PURE__ */ import_react146.default.createElement(Spacer_default, { px: 20 }), /* @__PURE__ */ import_react146.default.createElement("p", { className: "text-header-3" }, "Columns to Keep from First Dataframe"), params.how !== "unique in right" /* UNIQUE_IN_RIGHT */ && /* @__PURE__ */ import_react146.default.createElement(
      MultiToggleColumns_default,
      {
        sheetData: sheetDataOne,
        selectedColumnIDs: params.selected_column_ids_one.concat(mergeKeyColumnIDsOne),
        disabledColumnIDs: mergeKeyColumnIDsOne,
        onChange: (newSelectedColumnIDs) => {
          setParams((oldDropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, oldDropDuplicateParams), {
              selected_column_ids_one: newSelectedColumnIDs
            });
          });
        }
      }
    ), params.how === "unique in right" /* UNIQUE_IN_RIGHT */ && /* @__PURE__ */ import_react146.default.createElement("p", null, "Finding the unique values in the second sheet doesn't keep any columns from the first sheet."), /* @__PURE__ */ import_react146.default.createElement(Spacer_default, { px: 20 }), /* @__PURE__ */ import_react146.default.createElement("div", null, /* @__PURE__ */ import_react146.default.createElement("p", { className: "text-header-3" }, "Columns to Keep from Second Dataframe"), params.how !== "unique in left" /* UNIQUE_IN_LEFT */ && /* @__PURE__ */ import_react146.default.createElement(
      MultiToggleColumns_default,
      {
        sheetData: sheetDataTwo,
        selectedColumnIDs: params.selected_column_ids_two.concat(mergeKeyColumnIDsTwo),
        disabledColumnIDs: mergeKeyColumnIDsTwo,
        onChange: (newSelectedColumnIDs) => {
          setParams((oldDropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, oldDropDuplicateParams), {
              selected_column_ids_two: newSelectedColumnIDs
            });
          });
        }
      }
    ), params.how === "unique in left" /* UNIQUE_IN_LEFT */ && /* @__PURE__ */ import_react146.default.createElement("p", null, "Finding the unique values in the first sheet doesn't keep any columns from the second sheet."))));
  };
  var MergeTaskpane_default = MergeTaskpane;

  // src/components/taskpanes/PivotTable/PivotTaskpane.tsx
  var import_react152 = __toESM(require_react());

  // src/components/taskpanes/PivotTable/PivotTableKeySelection.tsx
  var import_react148 = __toESM(require_react());

  // src/components/taskpanes/PivotTable/PivotInvalidSelectedColumnsError.tsx
  var import_react147 = __toESM(require_react());
  var PivotInvalidSelectedColumnsError = (props) => {
    const invalidSelectedColumnIDs = props.selectedColumnIDs.filter(
      (columnID) => props.columnIDsMap[columnID] === void 0
    );
    (0, import_react147.useEffect)(() => {
      if (invalidSelectedColumnIDs.length > 0) {
        void props.mitoAPI.log("pivot_invalid_selected_columns", {
          "pivot_section": props.pivotSection,
          "num_invalid": invalidSelectedColumnIDs.length
        });
      }
    }, []);
    return /* @__PURE__ */ import_react147.default.createElement(import_react147.default.Fragment, null, invalidSelectedColumnIDs.length > 0 && /* @__PURE__ */ import_react147.default.createElement("div", { className: "text-color-error", style: { overflowX: "hidden" } }, "The ", invalidSelectedColumnIDs.length === 1 ? "column" : "columns", " ", invalidSelectedColumnIDs.length === 1 ? invalidSelectedColumnIDs[0] : invalidSelectedColumnIDs.join(", "), " ", invalidSelectedColumnIDs.length === 1 ? "does" : "do", " not exist in this sheet anymore. Delete ", invalidSelectedColumnIDs.length === 1 ? "it" : "them", " to make this pivot valid."));
  };
  var PivotInvalidSelectedColumnsError_default = PivotInvalidSelectedColumnsError;

  // src/components/taskpanes/PivotTable/PivotTableKeySelection.tsx
  var PIVOT_COLUMN_TRANSFORM_TITLES = {
    "no-op": "exact time",
    "year": "year",
    "year-quarter": "year-quarter",
    "year-month": "year-month",
    "year-month-day": "year-month-day",
    "year-month-day-hour": "year-month-day-hour",
    "year-month-day-hour-minute": "year-month-day-hour-minute",
    "quarter": "quarter",
    "month": "month",
    "week": "week",
    "day of month": "day of month",
    "day of week": "day of week",
    "hour": "hour",
    "minute": "minute",
    "second": "second",
    "month-day": "month-day",
    "day-hour": "day-hour",
    "hour-minute": "hour-minute"
  };
  var GROUP_DATE_BY_TOOLTIP = "Date columns can be further processed before being aggregated. For example, if you want to compare the aggregated values across months, then select `months` in this dropdown.";
  var ROWS_TOOLTIP = "Rows are used to group your source data into distinct buckets. The unique values that create the buckets are placed in the first column of the resulting pivot table.";
  var COLUMNS_TOOLTIP = "Columns are used to group your source data into distinct buckets. The unique values that create the buckets are placed across the top of the resulting pivot table. For the best performance, select columns with a small number of unique values.";
  var PivotTableKeySelection = (props) => {
    var _a, _b;
    const columnIDsMap = ((_a = props.sheetData) == null ? void 0 : _a.columnIDsMap) || {};
    const columnDtypeMap = ((_b = props.sheetData) == null ? void 0 : _b.columnDtypeMap) || {};
    const columnIdsWithTransforms = props.rowOrColumn === "pivotRowColumnIDsWithTransforms" ? [...props.params.pivotRowColumnIDsWithTransforms] : [...props.params.pivotColumnsColumnIDsWithTransforms];
    const pivotTableKeyCards = columnIdsWithTransforms.map(({ column_id, transformation }, keyIndex) => {
      const columnID = columnDtypeMap[column_id];
      const selectAndXIcon = /* @__PURE__ */ import_react148.default.createElement(
        SelectAndXIconCard_default,
        {
          key: keyIndex,
          value: column_id,
          titleMap: columnIDMapToDisplayHeadersMap(columnIDsMap),
          onChange: (columnID2) => {
            props.setParams((oldPivotParams) => {
              const newColumnIDsWithTransforms = [...columnIdsWithTransforms];
              newColumnIDsWithTransforms[keyIndex].column_id = columnID2;
              return __spreadProps(__spreadValues({}, oldPivotParams), {
                [props.rowOrColumn]: newColumnIDsWithTransforms
              });
            });
          },
          onDelete: () => {
            props.setParams((oldPivotParams) => {
              const newColumnIDsWithTransforms = [...columnIdsWithTransforms];
              newColumnIDsWithTransforms.splice(keyIndex, 1);
              return __spreadProps(__spreadValues({}, oldPivotParams), {
                [props.rowOrColumn]: newColumnIDsWithTransforms
              });
            });
          },
          selectableValues: Object.keys(columnIDsMap)
        }
      );
      if (columnID !== void 0 && isDatetimeDtype(columnID)) {
        return /* @__PURE__ */ import_react148.default.createElement("div", { className: "mito-blue-container mt-4px mb-4px", key: keyIndex }, selectAndXIcon, /* @__PURE__ */ import_react148.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react148.default.createElement(Col_default, { offset: 0.25 }, /* @__PURE__ */ import_react148.default.createElement(LabelAndTooltip_default, { tooltip: GROUP_DATE_BY_TOOLTIP }, "group date by")), /* @__PURE__ */ import_react148.default.createElement(Col_default, { offsetRight: 3 }, /* @__PURE__ */ import_react148.default.createElement(
          Select_default,
          {
            value: transformation,
            onChange: (newTransformation) => {
              props.setParams((oldPivotParams) => {
                const newColumnIDsWithTransforms = [...columnIdsWithTransforms];
                newColumnIDsWithTransforms[keyIndex].transformation = newTransformation;
                return __spreadProps(__spreadValues({}, oldPivotParams), {
                  [props.rowOrColumn]: newColumnIDsWithTransforms
                });
              });
            },
            searchable: true,
            width: "medium"
          },
          Object.entries(PIVOT_COLUMN_TRANSFORM_TITLES).map(([key2, value]) => {
            return /* @__PURE__ */ import_react148.default.createElement(
              DropdownItem_default,
              {
                key: key2,
                id: key2,
                title: value
              }
            );
          })
        ))));
      }
      return selectAndXIcon;
    });
    return /* @__PURE__ */ import_react148.default.createElement("div", null, /* @__PURE__ */ import_react148.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react148.default.createElement(Col_default, null, /* @__PURE__ */ import_react148.default.createElement(LabelAndTooltip_default, { tooltip: props.rowOrColumn === "pivotRowColumnIDsWithTransforms" ? ROWS_TOOLTIP : COLUMNS_TOOLTIP }, props.sectionTitle)), /* @__PURE__ */ import_react148.default.createElement(Col_default, null, /* @__PURE__ */ import_react148.default.createElement(
      DropdownButton_default,
      {
        text: "+ Add",
        width: "small",
        searchable: true
      },
      Object.entries(columnIDsMap).map(([columnID, columnHeader]) => {
        return /* @__PURE__ */ import_react148.default.createElement(
          DropdownItem_default,
          {
            key: columnID,
            title: getDisplayColumnHeader(columnHeader),
            onClick: () => {
              props.setParams((oldPivotParams) => {
                const newColumnIDsWithTransforms = [...columnIdsWithTransforms];
                newColumnIDsWithTransforms.push({
                  "column_id": columnID,
                  "transformation": "no-op"
                });
                return __spreadProps(__spreadValues({}, oldPivotParams), {
                  [props.rowOrColumn]: newColumnIDsWithTransforms
                });
              });
            }
          }
        );
      })
    ))), /* @__PURE__ */ import_react148.default.createElement(
      PivotInvalidSelectedColumnsError_default,
      {
        columnIDsMap,
        selectedColumnIDs: columnIdsWithTransforms.map(({ column_id }) => column_id),
        pivotSection: props.rowOrColumn === "pivotRowColumnIDsWithTransforms" ? "row" : "column",
        mitoAPI: props.mitoAPI
      }
    ), pivotTableKeyCards);
  };
  var PivotTableKeySelection_default = PivotTableKeySelection;

  // src/components/taskpanes/PivotTable/PivotTableValueSelection.tsx
  var import_react150 = __toESM(require_react());

  // src/components/taskpanes/PivotTable/PivotTableValueAggregationCard.tsx
  var import_react149 = __toESM(require_react());

  // src/components/taskpanes/PivotTable/pivotUtils.tsx
  var STRING_AGGREGATIONS = [
    "count" /* COUNT */,
    "count unique" /* COUNT_UNIQUE */
  ];
  var DATETIME_AGGREGATIONS = [
    "count" /* COUNT */,
    "count unique" /* COUNT_UNIQUE */,
    "mean" /* MEAN */,
    "median" /* MEDIAN */,
    "min" /* MIN */,
    "max" /* MAX */
  ];
  var TIMEDELTA_AGGREGATIONS = [
    "count" /* COUNT */,
    "count unique" /* COUNT_UNIQUE */,
    "sum" /* SUM */,
    "mean" /* MEAN */,
    "median" /* MEDIAN */,
    "min" /* MIN */,
    "max" /* MAX */
  ];
  var getDefaultPivotParams = (sheetDataArray2, sourceSheetIndex, existingPivotParams) => {
    if (sheetDataArray2.length === 0) {
      return void 0;
    }
    if (existingPivotParams === void 0) {
      return {
        sourceSheetIndex,
        pivotRowColumnIDsWithTransforms: [],
        pivotColumnsColumnIDsWithTransforms: [],
        pivotValuesColumnIDsArray: [],
        pivotFilters: [],
        flattenColumnHeaders: true,
        destinationSheetIndex: void 0
      };
    }
    return getPivotFrontendParamsFromBackendParams(existingPivotParams);
  };
  var getPivotFrontendParamsFromBackendParams = (pivotParams) => {
    return {
      sourceSheetIndex: pivotParams.sheet_index,
      pivotRowColumnIDsWithTransforms: pivotParams.pivot_rows_column_ids_with_transforms,
      pivotColumnsColumnIDsWithTransforms: pivotParams.pivot_columns_column_ids_with_transforms,
      pivotValuesColumnIDsArray: valuesRecordToArray(pivotParams.values_column_ids_map),
      pivotFilters: pivotParams.pivot_filters,
      flattenColumnHeaders: pivotParams.flatten_column_headers,
      destinationSheetIndex: pivotParams.destination_sheet_index
    };
  };
  var getPivotBackendParamsFromFrontendParams = (params, sheetDataArray2) => {
    var _a;
    const columnDtypeMap = sheetDataArray2 !== void 0 ? ((_a = sheetDataArray2[params.sourceSheetIndex]) == null ? void 0 : _a.columnDtypeMap) || {} : {};
    const pivotFiltersToApply = params.pivotFilters.map(({ column_id, filter }) => {
      const columnDtype = columnDtypeMap[column_id] || "";
      const finalFilters = getFiltersToApply([filter], columnDtype);
      if (finalFilters.length === 0) {
        return void 0;
      }
      return {
        "column_id": column_id,
        "filter": finalFilters[0]
      };
    }).filter((pf) => pf !== void 0);
    return {
      sheet_index: params.sourceSheetIndex,
      pivot_rows_column_ids_with_transforms: params.pivotRowColumnIDsWithTransforms,
      pivot_columns_column_ids_with_transforms: params.pivotColumnsColumnIDsWithTransforms,
      values_column_ids_map: valuesArrayToRecord(params.pivotValuesColumnIDsArray),
      pivot_filters: pivotFiltersToApply,
      flatten_column_headers: params.flattenColumnHeaders,
      destination_sheet_index: params.destinationSheetIndex
    };
  };
  var valuesRecordToArray = (valuesRecord) => {
    const valuesArray = [];
    Object.keys(valuesRecord).forEach((columnHeader) => {
      valuesRecord[columnHeader].forEach((aggregationType) => {
        valuesArray.push([columnHeader, aggregationType]);
      });
    });
    return valuesArray;
  };
  var valuesArrayToRecord = (valuesArray) => {
    const valuesRecord = {};
    for (let i = 0; i < valuesArray.length; i++) {
      const [columnHeader, aggregationType] = valuesArray[i];
      if (valuesRecord[columnHeader] === void 0) {
        valuesRecord[columnHeader] = [];
      }
      valuesRecord[columnHeader].push(aggregationType);
    }
    return valuesRecord;
  };
  var getPivotAggregationDisabledMessage = (aggregationType, columnDtype) => {
    if (isStringDtype(columnDtype) && !STRING_AGGREGATIONS.includes(aggregationType)) {
      return `Not valid for string column`;
    } else if (isDatetimeDtype(columnDtype) && !DATETIME_AGGREGATIONS.includes(aggregationType)) {
      return `Not valid for datetime column`;
    } else if (isTimedeltaDtype(columnDtype) && !TIMEDELTA_AGGREGATIONS.includes(aggregationType)) {
      return `Not valid for timedelta column`;
    }
    return void 0;
  };

  // src/components/taskpanes/PivotTable/PivotTableValueAggregationCard.tsx
  var PivotTableValueAggregationCard = (props) => {
    const aggregationTypeList = Object.values(AggregationType);
    const setAggregationType = (aggregationType) => {
      const aggregationTypeCast = aggregationType;
      if (aggregationTypeList.includes(aggregationTypeCast)) {
        props.editPivotValueAggregation(aggregationTypeCast, props.columnID);
      }
    };
    return /* @__PURE__ */ import_react149.default.createElement(Row_default, { align: "center" }, /* @__PURE__ */ import_react149.default.createElement(Col_default, null, /* @__PURE__ */ import_react149.default.createElement(
      Select_default,
      {
        value: props.aggregationType,
        onChange: setAggregationType,
        width: "small",
        dropdownWidth: "medium"
      },
      aggregationTypeList.map((aggregationType) => {
        const disabledMessage = getPivotAggregationDisabledMessage(aggregationType, props.columnDtype);
        return /* @__PURE__ */ import_react149.default.createElement(
          DropdownItem_default,
          {
            key: aggregationType,
            title: aggregationType,
            disabled: disabledMessage !== void 0,
            subtext: disabledMessage,
            hideSubtext: true,
            displaySubtextOnHover: true
          }
        );
      })
    )), /* @__PURE__ */ import_react149.default.createElement(Col_default, { offset: 1, flex: "1" }, /* @__PURE__ */ import_react149.default.createElement(
      Select_default,
      {
        value: props.columnID,
        onChange: (columnID) => {
          props.editPivotValueAggregation(
            props.aggregationType,
            columnID
          );
        },
        searchable: true
      },
      Object.keys(props.columnIDsMap).map((columnID) => {
        const columnHeader = props.columnIDsMap[columnID];
        return /* @__PURE__ */ import_react149.default.createElement(
          DropdownItem_default,
          {
            key: columnID,
            id: columnID,
            title: getDisplayColumnHeader(columnHeader)
          }
        );
      })
    )), /* @__PURE__ */ import_react149.default.createElement(Col_default, { offset: 1, offsetRight: 1 }, /* @__PURE__ */ import_react149.default.createElement(
      XIcon_default,
      {
        onClick: () => props.removePivotValueAggregation()
      }
    )));
  };
  var PivotTableValueAggregationCard_default = PivotTableValueAggregationCard;

  // src/components/taskpanes/PivotTable/PivotTableValueSelection.tsx
  var VALUES_TOOLTIP = "Values are used to summarize your source data for each of the pivot table buckets. These buckets are created by the rows and/or columns selected above.";
  var PivotTableValueSelection = (props) => {
    var _a, _b;
    const columnIDsMap = ((_a = props.sheetData) == null ? void 0 : _a.columnIDsMap) || {};
    const columnDtypeMap = ((_b = props.sheetData) == null ? void 0 : _b.columnDtypeMap) || {};
    return /* @__PURE__ */ import_react150.default.createElement("div", null, /* @__PURE__ */ import_react150.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react150.default.createElement(Col_default, null, /* @__PURE__ */ import_react150.default.createElement(LabelAndTooltip_default, { tooltip: VALUES_TOOLTIP }, "Values")), /* @__PURE__ */ import_react150.default.createElement(Col_default, null, /* @__PURE__ */ import_react150.default.createElement(
      DropdownButton_default,
      {
        text: "+ Add",
        width: "small",
        searchable: true
      },
      Object.entries(columnIDsMap).map(([columnID, columnHeader]) => {
        return /* @__PURE__ */ import_react150.default.createElement(
          DropdownItem_default,
          {
            key: columnID,
            title: getDisplayColumnHeader(columnHeader),
            onClick: () => {
              props.setParams((oldPivotParams) => {
                const newPivotValuesIDs = [...oldPivotParams.pivotValuesColumnIDsArray];
                newPivotValuesIDs.push([columnID, "count" /* COUNT */]);
                return __spreadProps(__spreadValues({}, oldPivotParams), {
                  pivotValuesColumnIDsArray: newPivotValuesIDs
                });
              });
            }
          }
        );
      })
    ))), /* @__PURE__ */ import_react150.default.createElement(
      PivotInvalidSelectedColumnsError_default,
      {
        columnIDsMap,
        pivotSection: "values",
        selectedColumnIDs: props.params.pivotValuesColumnIDsArray.map(([columnID]) => columnID),
        mitoAPI: props.mitoAPI
      }
    ), props.params.pivotValuesColumnIDsArray.map(([columnID, aggregationType], valueIndex) => {
      var _a2;
      const columnDtype = ((_a2 = props.sheetData) == null ? void 0 : _a2.columnDtypeMap[columnID]) || "";
      return /* @__PURE__ */ import_react150.default.createElement(
        PivotTableValueAggregationCard_default,
        {
          key: columnID + valueIndex + aggregationType,
          columnIDsMap,
          columnID,
          columnDtype,
          aggregationType,
          removePivotValueAggregation: () => {
            props.setParams((oldPivotParams) => {
              const newPivotValuesIDs = [...oldPivotParams.pivotValuesColumnIDsArray];
              newPivotValuesIDs.splice(valueIndex, 1);
              return __spreadProps(__spreadValues({}, oldPivotParams), {
                pivotValuesColumnIDsArray: newPivotValuesIDs
              });
            });
          },
          editPivotValueAggregation: (newAggregationType, newColumnID) => {
            props.setParams((oldPivotParams) => {
              const newPivotValuesIDs = [...oldPivotParams.pivotValuesColumnIDsArray];
              const columnDtype2 = columnDtypeMap[newColumnID] || "";
              const isInvalidAggregation = getPivotAggregationDisabledMessage(aggregationType, columnDtype2) !== void 0;
              if (isInvalidAggregation) {
                newAggregationType = "count" /* COUNT */;
              }
              newPivotValuesIDs[valueIndex] = [newColumnID, newAggregationType];
              return __spreadProps(__spreadValues({}, oldPivotParams), {
                pivotValuesColumnIDsArray: newPivotValuesIDs
              });
            });
          }
        }
      );
    }));
  };
  var PivotTableValueSelection_default = PivotTableValueSelection;

  // src/components/taskpanes/PivotTable/PivotTableFilterSection.tsx
  var import_react151 = __toESM(require_react());
  var FILTERS_TOOLTIP = "Filters are used to only include a subset of the source data in the pivot table.";
  var PivotTableFilterSection = (props) => {
    var _a;
    const columnIDsMap = ((_a = props.sheetData) == null ? void 0 : _a.columnIDsMap) || {};
    const allColumnIDs = Object.keys(columnIDsMap);
    const columnIDsToDisplayHeaders = {};
    Object.entries(columnIDsMap).map(([columnID, columnHeader]) => {
      columnIDsToDisplayHeaders[columnID] = getDisplayColumnHeader(columnHeader);
    });
    return /* @__PURE__ */ import_react151.default.createElement("div", null, /* @__PURE__ */ import_react151.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react151.default.createElement(Col_default, null, /* @__PURE__ */ import_react151.default.createElement(LabelAndTooltip_default, { tooltip: FILTERS_TOOLTIP }, "Filters")), /* @__PURE__ */ import_react151.default.createElement(Col_default, null, /* @__PURE__ */ import_react151.default.createElement(
      DropdownButton_default,
      {
        text: "+ Add",
        width: "small",
        searchable: true
      },
      Object.entries(columnIDsMap).map(([columnID, columnHeader]) => {
        return /* @__PURE__ */ import_react151.default.createElement(
          DropdownItem_default,
          {
            key: columnID,
            title: getDisplayColumnHeader(columnHeader),
            onClick: () => {
              props.setParams((prevParams) => {
                const newFiltersArray = [{
                  "column_id": columnID,
                  "filter": {
                    "condition": "not_empty",
                    "value": ""
                  }
                }];
                const newFilters = newFiltersArray.concat(prevParams.pivotFilters);
                return __spreadProps(__spreadValues({}, prevParams), {
                  pivotFilters: newFilters
                });
              });
            }
          }
        );
      })
    ))), /* @__PURE__ */ import_react151.default.createElement(
      PivotInvalidSelectedColumnsError_default,
      {
        columnIDsMap,
        pivotSection: "values",
        selectedColumnIDs: props.params.pivotFilters.map(({ column_id }) => column_id),
        mitoAPI: props.mitoAPI
      }
    ), props.params.pivotFilters.map(({ column_id, filter }, index) => {
      var _a2;
      const columnDtype = ((_a2 = props.sheetData) == null ? void 0 : _a2.columnDtypeMap[column_id]) || "";
      return /* @__PURE__ */ import_react151.default.createElement("div", { className: "mito-blue-container mb-5px", key: index }, /* @__PURE__ */ import_react151.default.createElement(Row_default, { suppressTopBottomMargin: true }, /* @__PURE__ */ import_react151.default.createElement(
        SelectAndXIconCard_default,
        {
          value: column_id,
          titleMap: columnIDsToDisplayHeaders,
          onChange: (newColumnId) => {
            props.setParams((prevParams) => {
              const newFilters = [...prevParams.pivotFilters];
              newFilters[index]["column_id"] = newColumnId;
              return __spreadProps(__spreadValues({}, prevParams), {
                pivotFilters: newFilters
              });
            });
          },
          onDelete: () => {
            props.setParams((prevParams) => {
              const newFilters = [...prevParams.pivotFilters];
              newFilters.splice(index, 1);
              return __spreadProps(__spreadValues({}, prevParams), {
                pivotFilters: newFilters
              });
            });
          },
          selectableValues: allColumnIDs
        }
      )), /* @__PURE__ */ import_react151.default.createElement(Row_default, { suppressTopBottomMargin: true }, /* @__PURE__ */ import_react151.default.createElement(
        Filter,
        {
          filter,
          operator: "And",
          displayOperator: false,
          setFilter: (newFilter) => {
            props.setParams((prevParams) => {
              const newFilters = [...prevParams.pivotFilters];
              newFilters[index]["filter"] = newFilter;
              return __spreadProps(__spreadValues({}, prevParams), {
                pivotFilters: newFilters
              });
            });
          },
          columnDtype,
          nameLength: "short_name",
          suppressTopBottomMargin: true
        }
      ), /* @__PURE__ */ import_react151.default.createElement(Col_default, { span: 3.5 })));
    }));
  };
  var PivotTableFilterSection_default = PivotTableFilterSection;

  // src/components/taskpanes/PivotTable/PivotTaskpane.tsx
  var PivotTaskpane = (props) => {
    const { params, setParams } = useLiveUpdatingParams_default(
      () => getDefaultPivotParams(props.sheetDataArray, props.sourceSheetIndex, props.existingPivotParams),
      "pivot" /* Pivot */,
      props.mitoAPI,
      props.analysisData,
      0,
      {
        getBackendFromFrontend: getPivotBackendParamsFromFrontendParams,
        getFrontendFromBackend: getPivotFrontendParamsFromBackendParams
      },
      {
        doNotSendDefaultParams: props.destinationSheetIndex !== void 0
      },
      props.sheetDataArray
    );
    if (params === void 0) {
      return /* @__PURE__ */ import_react152.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    const sheetData = props.sheetDataArray[params.sourceSheetIndex];
    return /* @__PURE__ */ import_react152.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react152.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: props.destinationSheetIndex ? `Edit Pivot Table ${props.dfNames[props.destinationSheetIndex]}` : `Create Pivot Table ${props.dfNames[props.dfNames.length - 1]}`,
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react152.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react152.default.createElement(
      DataframeSelect_default,
      {
        title: "Dataframe to pivot",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: params.sourceSheetIndex,
        onChange: (newSheetIndex) => {
          const newParams = getDefaultPivotParams(props.sheetDataArray, newSheetIndex, void 0);
          setParams((prevParams) => {
            return newParams || prevParams;
          });
        },
        sheetIndexToIgnore: props.destinationSheetIndex
      }
    ), /* @__PURE__ */ import_react152.default.createElement("div", { className: "default-taskpane-body-section-div" }, /* @__PURE__ */ import_react152.default.createElement(
      PivotTableKeySelection_default,
      {
        mitoAPI: props.mitoAPI,
        sheetData,
        sectionTitle: "Rows",
        params,
        setParams,
        rowOrColumn: "pivotRowColumnIDsWithTransforms"
      }
    )), /* @__PURE__ */ import_react152.default.createElement("div", { className: "default-taskpane-body-section-div" }, /* @__PURE__ */ import_react152.default.createElement(
      PivotTableKeySelection_default,
      {
        mitoAPI: props.mitoAPI,
        sheetData,
        sectionTitle: "Columns",
        params,
        setParams,
        rowOrColumn: "pivotColumnsColumnIDsWithTransforms"
      }
    )), /* @__PURE__ */ import_react152.default.createElement("div", { className: "default-taskpane-body-section-div" }, /* @__PURE__ */ import_react152.default.createElement(
      PivotTableValueSelection_default,
      {
        mitoAPI: props.mitoAPI,
        sheetData,
        params,
        setParams
      }
    )), /* @__PURE__ */ import_react152.default.createElement("div", { className: "default-taskpane-body-section-div" }, /* @__PURE__ */ import_react152.default.createElement(
      PivotTableFilterSection_default,
      {
        sheetData,
        params,
        setParams,
        mitoAPI: props.mitoAPI
      }
    ))));
  };
  var PivotTaskpane_default = PivotTaskpane;

  // src/components/taskpanes/SplitTextToColumns/SplitTextToColumnsTaskpane.tsx
  var import_react154 = __toESM(require_react());

  // src/components/elements/MulitSelectButtonItem.tsx
  var import_react153 = __toESM(require_react());
  var MultiSelectButtonItem = (props) => {
    return /* @__PURE__ */ import_react153.default.createElement(
      "div",
      {
        key: props.title,
        onClick: () => {
          props.onToggle(props.id ? props.id : props.title);
        },
        className: "text-body-2"
      },
      /* @__PURE__ */ import_react153.default.createElement("input", { type: "checkbox", name: props.title, value: props.id ? props.id : props.title, checked: props.checked }),
      /* @__PURE__ */ import_react153.default.createElement("label", { style: { marginRight: "3px" }, htmlFor: props.title }, props.title)
    );
  };
  var MulitSelectButtonItem_default = MultiSelectButtonItem;

  // src/components/taskpanes/SplitTextToColumns/SplitTextToColumnsTaskpane.tsx
  var delimiters = { ",": "Comma", "-": "Dash", "	": "Tab", " ": "Space" };
  var getDefaultParams6 = (startingColumnID, sheetDataArray2, sheetIndex) => {
    var _a;
    if (sheetDataArray2.length === 0 || sheetDataArray2[sheetIndex] === void 0) {
      return void 0;
    }
    let columnID = void 0;
    if (startingColumnID !== void 0 && Object.keys(sheetDataArray2[sheetIndex].columnIDsMap).includes(startingColumnID)) {
      columnID = startingColumnID;
    } else {
      columnID = Object.keys(((_a = sheetDataArray2[sheetIndex]) == null ? void 0 : _a.columnIDsMap) || {})[0];
    }
    return {
      sheet_index: sheetIndex,
      column_id: columnID,
      delimiters: [],
      new_column_header_suffix: getNewColumnHeader()
    };
  };
  var SplitTextToColumnsTaskpane = (props) => {
    var _a, _b;
    const { params, setParams, loading, edit, editApplied, result } = useSendEditOnClick_default(
      () => getDefaultParams6(props.startingColumnID, props.sheetDataArray, props.selectedSheetIndex),
      "split_text_to_columns" /* SplitTextToColumns */,
      props.mitoAPI,
      props.analysisData
    );
    const [preview, setPreview] = (0, import_react154.useState)([]);
    (0, import_react154.useEffect)(() => {
      setParams((prevParams) => {
        const newParams = getDefaultParams6(props.startingColumnID, props.sheetDataArray, props.selectedSheetIndex);
        if (newParams) {
          return newParams;
        }
        return prevParams;
      });
    }, [props.startingColumnID]);
    (0, import_react154.useEffect)(() => {
      void loadSplitTextToColumnsPreview();
    }, [params]);
    async function loadSplitTextToColumnsPreview() {
      if (params !== void 0 && params.column_id !== void 0 && params.delimiters.length > 0) {
        const _splitTextToColumnsPreviewArray = await props.mitoAPI.getSplitTextToColumnsPreview(params);
        if (_splitTextToColumnsPreviewArray !== void 0) {
          setPreview(_splitTextToColumnsPreviewArray);
        } else {
          setPreview([]);
        }
      } else {
        setPreview([]);
      }
    }
    if (params === void 0 || params.column_id === void 0) {
      return /* @__PURE__ */ import_react154.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    return /* @__PURE__ */ import_react154.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react154.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Split Text to Columns",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react154.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react154.default.createElement(
      DataframeSelect_default,
      {
        title: "Dataframe to select a column to split text within",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: params.sheet_index,
        onChange: (newSheetIndex) => {
          setParams((prevParams) => {
            const newParams = getDefaultParams6(void 0, props.sheetDataArray, newSheetIndex);
            if (newParams) {
              return newParams;
            }
            return __spreadProps(__spreadValues({}, prevParams), {
              sheet_index: newSheetIndex
            });
          });
        }
      }
    ), /* @__PURE__ */ import_react154.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react154.default.createElement(Col_default, null, /* @__PURE__ */ import_react154.default.createElement("p", { className: "text-header-3" }, "Column")), /* @__PURE__ */ import_react154.default.createElement(Col_default, null, /* @__PURE__ */ import_react154.default.createElement(
      Select_default,
      {
        width: "medium-large",
        value: getDisplayColumnHeader(((_a = props.sheetDataArray[params.sheet_index]) == null ? void 0 : _a.columnIDsMap[params.column_id]) || "select a column"),
        searchable: true
      },
      Object.entries(((_b = props.sheetDataArray[params.sheet_index]) == null ? void 0 : _b.columnIDsMap) || {}).map(([columnID, columnHeader]) => {
        return /* @__PURE__ */ import_react154.default.createElement(
          DropdownItem_default,
          {
            key: columnID,
            title: getDisplayColumnHeader(columnHeader),
            onClick: () => {
              setParams((prevParams) => {
                return __spreadProps(__spreadValues({}, prevParams), {
                  column_id: columnID
                });
              });
            }
          }
        );
      })
    ))), /* @__PURE__ */ import_react154.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react154.default.createElement(Col_default, { span: 6 }, /* @__PURE__ */ import_react154.default.createElement("p", { className: "text-header-3" }, "Delimiters")), /* @__PURE__ */ import_react154.default.createElement(Col_default, { className: "light-gray-container element-width-medium-large" }, Object.entries(delimiters).map(([delimiter, delimiterTitle]) => {
      return /* @__PURE__ */ import_react154.default.createElement(
        MulitSelectButtonItem_default,
        {
          key: delimiterTitle,
          id: delimiter,
          title: delimiterTitle,
          checked: params.delimiters.includes(delimiter),
          onToggle: (delimiter2) => {
            setParams((prevParams) => {
              const newDelimiters = [...prevParams.delimiters];
              toggleInArray(newDelimiters, delimiter2);
              return __spreadProps(__spreadValues({}, prevParams), {
                delimiters: newDelimiters
              });
            });
          }
        }
      );
    }), /* @__PURE__ */ import_react154.default.createElement(
      Input_default,
      {
        value: params.delimiters.filter((params_delimiter) => !Object.keys(delimiters).includes(params_delimiter))[0],
        placeholder: "Custom Delimiter",
        className: "mt-5px",
        onChange: (e) => {
          const newValue = e.target.value;
          setParams((prevParams) => {
            const newDelimiters = [...prevParams.delimiters].filter((delimiter) => Object.keys(delimiters).includes(delimiter));
            if (newValue !== "") {
              newDelimiters.push(newValue);
            }
            return __spreadProps(__spreadValues({}, prevParams), {
              delimiters: newDelimiters
            });
          });
        }
      }
    ))), /* @__PURE__ */ import_react154.default.createElement("div", null, /* @__PURE__ */ import_react154.default.createElement(Row_default, null, /* @__PURE__ */ import_react154.default.createElement("p", { className: "text-header-3" }, "Columns Preview")), preview.length > 0 && /* @__PURE__ */ import_react154.default.createElement(Row_default, { style: { width: "100%", overflowX: "auto" }, suppressTopBottomMargin: true }, /* @__PURE__ */ import_react154.default.createElement("table", { className: "preview-table", cellSpacing: "0" }, /* @__PURE__ */ import_react154.default.createElement("tbody", null, preview.map((rowData, idx) => {
      return /* @__PURE__ */ import_react154.default.createElement("tr", { className: "preview-table-table-row", key: idx }, rowData.map((cellData, idx2) => {
        return /* @__PURE__ */ import_react154.default.createElement("td", { className: "preview-table-table-data", key: idx2 }, "" + cellData);
      }));
    })))), preview.length === 0 && /* @__PURE__ */ import_react154.default.createElement(Row_default, { style: { width: "100%" }, justify: "center" }, /* @__PURE__ */ import_react154.default.createElement("p", { className: "mt-10px" }, "Select a delimiter to preview the split")))), /* @__PURE__ */ import_react154.default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ import_react154.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => edit((prevParams) => {
          return __spreadProps(__spreadValues({}, prevParams), {
            new_column_header_suffix: getNewColumnHeader()
          });
        }),
        disabled: params.delimiters.length === 0,
        disabledTooltip: "Select at least one delimiter"
      },
      !editApplied ? `Split on delimiter${params.delimiters.length > 1 ? "s" : ""}` : loading ? "Splitting column ..." : `Split on delimiter${params.delimiters.length > 1 ? "s" : ""}`
    ), editApplied && /* @__PURE__ */ import_react154.default.createElement("p", { className: "text-subtext-1" }, "Created ", result == null ? void 0 : result.num_cols_created, " new columns"), !editApplied && /* @__PURE__ */ import_react154.default.createElement(Spacer_default, { px: 18 })));
  };
  var SplitTextToColumnsTaskpane_default = SplitTextToColumnsTaskpane;

  // src/components/taskpanes/UpdateImports/UpdateImportsTaskpane.tsx
  var import_react163 = __toESM(require_react());

  // src/components/taskpanes/UpdateImports/UpdateDataframeImportTaskpane.tsx
  var import_react155 = __toESM(require_react());
  var getButtonMessage5 = (params) => {
    if (params.df_names.length === 0) {
      return `Select dataframe to update`;
    }
    return `Update to ${params.df_names[0]}`;
  };
  var UpdateDataframeImportScreen = (props) => {
    var _a, _b;
    const [dfNamesInNotebook, loading] = useStateFromAPIAsync(
      [],
      () => {
        return props.mitoAPI.getDefinedDfNames();
      },
      void 0,
      []
    );
    const radioButtonBox = /* @__PURE__ */ import_react155.default.createElement(
      RadioButtonBox_default,
      {
        values: dfNamesInNotebook,
        selectedValue: (_a = props.params) == null ? void 0 : _a.df_names[0],
        onChange: (newDfName) => props.setParams((prevParams) => {
          return __spreadProps(__spreadValues({}, prevParams), {
            df_names: [newDfName]
          });
        }),
        loading
      }
    );
    if (props.params === void 0) {
      return /* @__PURE__ */ import_react155.default.createElement("div", { className: "text-body-1" }, "There has been an error loading dataframes to import. Please try again, or ", /* @__PURE__ */ import_react155.default.createElement("a", { className: "text-body-1-link", href: "https://join.slack.com/t/trymito/shared_invite/zt-1h6t163v7-xLPudO7pjQNKccXz7h7GSg", target: "_blank", rel: "noreferrer" }, "contact support"), ".");
    }
    return /* @__PURE__ */ import_react155.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react155.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: props.isUpdate ? "Import Dataframes" : "Update Import",
        setUIState: props.setUIState,
        backCallback: props.backCallback,
        notCloseable: props.notCloseable
      }
    ), /* @__PURE__ */ import_react155.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react155.default.createElement(Row_default, { justify: "start", align: "center" }, /* @__PURE__ */ import_react155.default.createElement(Col_default, null, /* @__PURE__ */ import_react155.default.createElement(LabelAndTooltip_default, { tooltip: "Dataframes that have been created elsewhere in this notebook can be imported through this taskpane." }, "Dataframes to Import"))), radioButtonBox, /* @__PURE__ */ import_react155.default.createElement(Spacer_default, { px: 10 })), /* @__PURE__ */ import_react155.default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ import_react155.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          props.edit();
        },
        disabled: (((_b = props.params) == null ? void 0 : _b.df_names.length) || 0) === 0
      },
      getButtonMessage5(props.params)
    )));
  };
  var UpdateDataframeImportTaskpane_default = UpdateDataframeImportScreen;

  // src/components/taskpanes/UpdateImports/UpdateImportsPostReplayTaskpane.tsx
  var import_react158 = __toESM(require_react());

  // src/components/taskpanes/UpdateImports/UpdateImportCard.tsx
  var import_react157 = __toESM(require_react());

  // src/components/icons/RightPointerIcon.tsx
  var import_react156 = __toESM(require_react());
  var RightPointerIcon = () => {
    return /* @__PURE__ */ import_react156.default.createElement("svg", { width: "10", height: "15", viewBox: "0 0 10 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react156.default.createElement("path", { d: "M1.36401 1.13672L7.72797 7.50068L1.36401 13.8646", stroke: "#494650", strokeWidth: "2", strokeLinecap: "round" }));
  };
  var RightPointerIcon_default = RightPointerIcon;

  // src/components/taskpanes/UpdateImports/updateImportsUtils.tsx
  function isCSVImportParams(params) {
    return params !== void 0 && "file_names" in params && !("sheet_names" in params);
  }
  function isExcelImportParams(params) {
    return params !== void 0 && "sheet_names" in params;
  }
  function isDataframeImportParams(params) {
    return params !== void 0 && "df_names" in params;
  }
  var getBaseOfPath = (fullPath) => {
    return fullPath.replace(/^.*[\\\\/]/, "");
  };
  function updateStepImportDataList(stepImportDataList, newDataframeCreationIndex, newDataframeCreationData) {
    const newStepImportDataList = [...stepImportDataList];
    let numSeen = 0;
    newStepImportDataList.forEach((stepImportData) => {
      if (numSeen + stepImportData.imports.length > newDataframeCreationIndex) {
        stepImportData.imports[newDataframeCreationIndex - numSeen] = newDataframeCreationData;
      }
      numSeen += stepImportData.imports.length;
    });
    return newStepImportDataList;
  }
  var getAllDataframeCreationData = (stepImportDataList) => {
    if (stepImportDataList === void 0) {
      return [];
    }
    return stepImportDataList.map((stepImportData) => {
      return stepImportData.imports;
    }).flat();
  };
  var getOriginalAndUpdatedDataframeCreationDataPairs = (originalStepImportData, updatedStepImportData) => {
    const originalImports = getAllDataframeCreationData(originalStepImportData);
    const newImports = originalStepImportData !== void 0 && updatedStepImportData === void 0 ? originalImports : getAllDataframeCreationData(updatedStepImportData);
    return originalImports.map((dfCreationData, index) => {
      return [dfCreationData, newImports[index]];
    });
  };
  var updateDataframeCreation = (dataframeCreationIndex, dataframeCreationData, setUpdatedStepImportData, setUpdatedIndexes, setInvalidImportMessages, setReplacingDataframeState) => {
    setUpdatedStepImportData((prevUpdatedStepImportData) => {
      if (prevUpdatedStepImportData === void 0) {
        return void 0;
      }
      return updateStepImportDataList(
        prevUpdatedStepImportData,
        dataframeCreationIndex,
        dataframeCreationData
      );
    });
    setUpdatedIndexes((prevUpdatedIndexes) => {
      if (prevUpdatedIndexes.includes(dataframeCreationIndex)) {
        return prevUpdatedIndexes;
      }
      const newUpdatedIndexes = [...prevUpdatedIndexes];
      newUpdatedIndexes.push(dataframeCreationIndex);
      return newUpdatedIndexes;
    });
    setInvalidImportMessages((prevInvalidImportMessage) => {
      const newInvalidImportMessage = __spreadValues({}, prevInvalidImportMessage);
      if (newInvalidImportMessage[dataframeCreationIndex] !== void 0) {
        delete newInvalidImportMessage[dataframeCreationIndex];
      }
      return newInvalidImportMessage;
    });
    setReplacingDataframeState(void 0);
  };
  var updateAllSnowflakeImports = (updatedStepImportData, setUpdatedStepImportData, setUpdatedIndexes, setInvalidImportMessages, setReplacingDataframeState) => {
    if (updatedStepImportData === void 0) {
      return;
    }
    updatedStepImportData.forEach((updatedStepImport, idx) => {
      if (updatedStepImport.imports[0].step_type === "snowflake_import") {
        updateDataframeCreation(
          idx,
          updatedStepImport.imports[0],
          setUpdatedStepImportData,
          setUpdatedIndexes,
          setInvalidImportMessages,
          setReplacingDataframeState
        );
      }
    });
  };
  var getErrorTextFromToFix = (toFix) => {
    return toFix + " Update imports to fix this error.";
  };

  // src/components/taskpanes/UpdateImports/UpdateImportCard.tsx
  var getFileNameSpanFromFilePath = (filePath) => {
    const fileName = getBaseOfPath(filePath);
    return /* @__PURE__ */ import_react157.default.createElement("span", { title: filePath }, fileName);
  };
  var getSimpleNameSpan = (name) => {
    return /* @__PURE__ */ import_react157.default.createElement("span", { title: name || "not definend" }, name);
  };
  var getUpdateImportCardTitle = (dataframeCreationData) => {
    if (dataframeCreationData.step_type === "excel_import") {
      return /* @__PURE__ */ import_react157.default.createElement("div", null, /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "Imported "), " ", getSimpleNameSpan(dataframeCreationData.params.sheet_names[0]), " ", /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "from "), " ", getFileNameSpanFromFilePath(dataframeCreationData.params.file_name));
    } else if (dataframeCreationData.step_type === "simple_import") {
      return /* @__PURE__ */ import_react157.default.createElement("div", null, /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "Imported "), " ", getFileNameSpanFromFilePath(dataframeCreationData.params.file_names[0]));
    } else if (dataframeCreationData.step_type === "dataframe_import") {
      return /* @__PURE__ */ import_react157.default.createElement("div", null, /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "Imported "), " ", getSimpleNameSpan(dataframeCreationData.params.df_names[0]));
    } else if (dataframeCreationData.step_type === "excel_range_import") {
      return /* @__PURE__ */ import_react157.default.createElement("div", null, /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "Imported "), " ", getSimpleNameSpan(dataframeCreationData.params.range_imports[0].df_name), " ", /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "from "), " ", getFileNameSpanFromFilePath(dataframeCreationData.params.file_path));
    } else if (dataframeCreationData.step_type === "snowflake_import") {
      return /* @__PURE__ */ import_react157.default.createElement("div", null, /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "Imported "), " ", getSimpleNameSpan(dataframeCreationData.params.table_loc_and_warehouse.table), " ", /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "from Snowflake "));
    } else {
      return /* @__PURE__ */ import_react157.default.createElement("div", null, /* @__PURE__ */ import_react157.default.createElement(import_react157.default.Fragment, null));
    }
  };
  var getUpdateImportCardSubtitle = (updatedDataframeCreationData, invalidImportMessage, isUpdated) => {
    if (!isUpdated) {
      if (invalidImportMessage !== void 0) {
        return /* @__PURE__ */ import_react157.default.createElement("div", { className: "mt-3px" }, /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-error-important text-overflow-wrap" }, invalidImportMessage));
      }
      return null;
    }
    if (updatedDataframeCreationData.step_type === "excel_import") {
      return /* @__PURE__ */ import_react157.default.createElement("div", { className: "mt-3px" }, /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "Update to "), " ", getSimpleNameSpan(updatedDataframeCreationData.params.sheet_names[0]), " ", /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "from "), " ", getFileNameSpanFromFilePath(updatedDataframeCreationData.params.file_name));
    } else if (updatedDataframeCreationData.step_type === "simple_import") {
      return /* @__PURE__ */ import_react157.default.createElement("div", { className: "mt-3px" }, /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "Update to "), " ", getFileNameSpanFromFilePath(updatedDataframeCreationData.params.file_names[0]));
    } else if (updatedDataframeCreationData.step_type === "dataframe_import") {
      return /* @__PURE__ */ import_react157.default.createElement("div", { className: "mt-3px" }, /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "Update to "), " ", getSimpleNameSpan(updatedDataframeCreationData.params.df_names[0]));
    } else if (updatedDataframeCreationData.step_type === "excel_range_import") {
      return /* @__PURE__ */ import_react157.default.createElement("div", { className: "mt-3px" }, /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "Update to "), " ", getSimpleNameSpan(updatedDataframeCreationData.params.range_imports[0].df_name), " ", /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-medium-gray-important" }, "from "), " ", getFileNameSpanFromFilePath(updatedDataframeCreationData.params.file_path));
    } else if (updatedDataframeCreationData.step_type === "snowflake_import") {
      return /* @__PURE__ */ import_react157.default.createElement("div", null, /* @__PURE__ */ import_react157.default.createElement(import_react157.default.Fragment, null));
    } else {
      return /* @__PURE__ */ import_react157.default.createElement("div", null, /* @__PURE__ */ import_react157.default.createElement(import_react157.default.Fragment, null));
    }
  };
  var UpdateImportCard = (props) => {
    const displayDropdown = props.displayedImportCardDropdown === props.dataframeCreationIndex;
    const openDropdown = () => {
      props.setDisplayedImportCardDropdown(props.dataframeCreationIndex);
    };
    const closeDropdown = () => {
      props.setDisplayedImportCardDropdown((prevValue) => {
        if (prevValue !== props.dataframeCreationIndex) {
          return prevValue;
        }
        return void 0;
      });
    };
    const getUpdateImportOptionDropdownItems = () => {
      let dropdownItems = [];
      if (props.dataframeCreationData.step_type === "snowflake_import") {
        dropdownItems.push(
          /* @__PURE__ */ import_react157.default.createElement(
            DropdownItem_default,
            {
              key: "Connect to Snowflake",
              title: "Connect to Snowflake",
              onClick: () => {
                props.setReplacingDataframeState({
                  dataframeCreationIndex: props.dataframeCreationIndex,
                  importState: { screen: "authenticate_to_snowflake" },
                  params: void 0
                });
              }
            }
          )
        );
      }
      dropdownItems = dropdownItems.concat([
        /* @__PURE__ */ import_react157.default.createElement(
          DropdownItem_default,
          {
            key: "Replace with file",
            title: "Replace with file",
            onClick: () => {
              props.setReplacingDataframeState({
                dataframeCreationIndex: props.dataframeCreationIndex,
                importState: { screen: "file_browser" },
                params: void 0
              });
            }
          }
        ),
        /* @__PURE__ */ import_react157.default.createElement(
          DropdownItem_default,
          {
            key: "Replace with dataframe",
            title: "Replace with dataframe",
            onClick: () => {
              props.setReplacingDataframeState({
                dataframeCreationIndex: props.dataframeCreationIndex,
                importState: { screen: "dataframe_import" },
                params: { df_names: [] }
              });
            }
          }
        )
      ]);
      return dropdownItems;
    };
    return /* @__PURE__ */ import_react157.default.createElement(Row_default, { justify: "space-between", align: "top", onClick: () => {
      openDropdown();
    } }, /* @__PURE__ */ import_react157.default.createElement(Col_default, { span: 22 }, /* @__PURE__ */ import_react157.default.createElement(Row_default, { align: "top" }, /* @__PURE__ */ import_react157.default.createElement("div", { className: "mt-1px" }, /* @__PURE__ */ import_react157.default.createElement(CSVFileIcon_default, null)), /* @__PURE__ */ import_react157.default.createElement(Col_default, { span: 22, offset: 0.25 }, getUpdateImportCardTitle(props.dataframeCreationData), getUpdateImportCardSubtitle(props.updatedDataframeCreationData, props.preUpdateInvalidImportMessage, props.isUpdated))), props.postUpdateInvalidImportMessage && /* @__PURE__ */ import_react157.default.createElement(Row_default, { align: "top" }, /* @__PURE__ */ import_react157.default.createElement(Col_default, { span: 22, offset: 1.2 }, /* @__PURE__ */ import_react157.default.createElement("span", { className: "text-color-error-important text-overflow-wrap" }, props.postUpdateInvalidImportMessage)))), /* @__PURE__ */ import_react157.default.createElement(Col_default, { className: "mt-3px" }, /* @__PURE__ */ import_react157.default.createElement("div", null, /* @__PURE__ */ import_react157.default.createElement(RightPointerIcon_default, null), /* @__PURE__ */ import_react157.default.createElement(
      Dropdown_default,
      {
        display: displayDropdown,
        closeDropdown: () => closeDropdown(),
        width: "medium"
      },
      getUpdateImportOptionDropdownItems()
    ))));
  };
  var UpdateImportCard_default = UpdateImportCard;

  // src/components/taskpanes/UpdateImports/UpdateImportsPostReplayTaskpane.tsx
  var UpdateImportsPostReplayTaskpane = (props) => {
    var _a, _b, _c;
    const [loadingUpdate, setLoadingUpdate] = (0, import_react158.useState)(false);
    let updateImportBody = null;
    if (props.importDataAndErrors === void 0) {
      updateImportBody = /* @__PURE__ */ import_react158.default.createElement("p", null, "Loading previously imported data...");
    } else {
      if ((((_a = props.importDataAndErrors) == null ? void 0 : _a.importData.length) || 0) === 0 && props.sheetDataArray.length === 0) {
        return /* @__PURE__ */ import_react158.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState, message: "Before changing imports, you need to import something." });
      } else if ((((_b = props.importDataAndErrors) == null ? void 0 : _b.importData.length) || 0) === 0) {
        return /* @__PURE__ */ import_react158.default.createElement(DefaultEmptyTaskpane_default, { header: "Update passed dataframes", setUIState: props.setUIState, message: "You can change imports by changing the data passed to the mitosheet.sheet call above.", suppressImportLink: true });
      }
      const originalAndUpdatedDataframeCreationPairs = getOriginalAndUpdatedDataframeCreationDataPairs(((_c = props.importDataAndErrors) == null ? void 0 : _c.importData) || [], props.updatedStepImportData);
      updateImportBody = originalAndUpdatedDataframeCreationPairs.map(([originalDfCreationData, updatedDfCreationData], index) => {
        return /* @__PURE__ */ import_react158.default.createElement(
          UpdateImportCard_default,
          {
            key: index,
            dataframeCreationIndex: index,
            dataframeCreationData: originalDfCreationData,
            isUpdated: props.updatedIndexes.includes(index),
            updatedDataframeCreationData: updatedDfCreationData,
            displayedImportCardDropdown: props.displayedImportCardDropdown,
            setDisplayedImportCardDropdown: props.setDisplayedImportCardDropdown,
            setReplacingDataframeState: props.setReplacingDataframeState,
            preUpdateInvalidImportMessage: void 0,
            postUpdateInvalidImportMessage: props.invalidImportMessages[index]
          }
        );
      });
    }
    const anyUpdated = props.updatedIndexes.length > 0;
    const invalidPostUpdate = Object.keys(props.invalidImportMessages).length > 0;
    const retryButtonDisabled = !anyUpdated || invalidPostUpdate || loadingUpdate;
    return /* @__PURE__ */ import_react158.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react158.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Change Imports",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react158.default.createElement(DefaultTaskpaneBody_default, null, props.invalidReplayError && /* @__PURE__ */ import_react158.default.createElement("p", { className: "text-color-error" }, props.invalidReplayError), updateImportBody), /* @__PURE__ */ import_react158.default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ import_react158.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        onClick: async () => {
          const doUpdate = async () => {
            if (props.updatedStepImportData === void 0) {
              return;
            }
            const _invalidImportIndexes = await props.mitoAPI.getTestImports(props.updatedStepImportData);
            if (_invalidImportIndexes === void 0) {
              return;
            }
            props.setInvalidImportMessages(_invalidImportIndexes);
            void props.mitoAPI.log("clicked_update_from_post_replay_update_imports");
            void props.mitoAPI.log("get_test_import_results", {
              "open_due_to_replay_error": false,
              "num_invalid_imports": Object.keys(_invalidImportIndexes).length
            });
            if (Object.keys(_invalidImportIndexes).length === 0) {
              const possibleMitoError = await props.mitoAPI.updateExistingImports(props.updatedStepImportData);
              if (isMitoError(possibleMitoError)) {
                props.setInvalidReplayError(getErrorTextFromToFix(possibleMitoError.to_fix));
              } else {
                props.setUIState((prevUIState) => {
                  return __spreadProps(__spreadValues({}, prevUIState), {
                    currOpenTaskpane: { type: "none" /* NONE */ },
                    currOpenPopups: __spreadProps(__spreadValues({}, prevUIState.currOpenPopups), {
                      ["top_right" /* TopRight */]: {
                        type: "ephemeral_message" /* EphemeralMessage */,
                        message: "Successfully replayed analysis on new data"
                      }
                    })
                  });
                });
              }
            }
          };
          setLoadingUpdate(true);
          await doUpdate();
          setLoadingUpdate(false);
        },
        disabled: retryButtonDisabled,
        disabledTooltip: retryButtonDisabled ? "Please resolve all errors with above imports." : void 0
      },
      /* @__PURE__ */ import_react158.default.createElement("p", { className: "text-align-center-important" }, !loadingUpdate ? "Change Imports" : "Changing Imports...")
    )));
  };
  var UpdateImportsPostReplayTaskpane_default = UpdateImportsPostReplayTaskpane;

  // src/components/taskpanes/UpdateImports/UpdateImportsPreReplayTaskpane.tsx
  var import_react159 = __toESM(require_react());
  var PRE_REPLAY_IMPORT_ERROR_TEXT = "Please fix failed data imports to replay analysis.";
  var UpdateImportsPreReplayTaskpane = (props) => {
    var _a;
    const [loadingUpdate, setLoadingUpdate] = (0, import_react159.useState)(false);
    let updateImportBody = null;
    const loadingImportDataAndErrors = props.importDataAndErrors === void 0;
    if (props.importDataAndErrors === void 0) {
      updateImportBody = /* @__PURE__ */ import_react159.default.createElement("p", null, "Loading previously imported data...");
    } else {
      const originalAndUpdatedDataframeCreationPairs = getOriginalAndUpdatedDataframeCreationDataPairs(props.importDataAndErrors.importData, props.updatedStepImportData);
      updateImportBody = originalAndUpdatedDataframeCreationPairs.map(([originalDfCreationData, updatedDfCreationData], index) => {
        var _a2;
        return /* @__PURE__ */ import_react159.default.createElement(
          UpdateImportCard_default,
          {
            key: index,
            dataframeCreationIndex: index,
            dataframeCreationData: originalDfCreationData,
            isUpdated: props.updatedIndexes.includes(index),
            updatedDataframeCreationData: updatedDfCreationData,
            displayedImportCardDropdown: props.displayedImportCardDropdown,
            setDisplayedImportCardDropdown: props.setDisplayedImportCardDropdown,
            setReplacingDataframeState: props.setReplacingDataframeState,
            preUpdateInvalidImportMessage: (_a2 = props.importDataAndErrors) == null ? void 0 : _a2.invalidImportMessages[index],
            postUpdateInvalidImportMessage: props.postUpdateInvalidImportMessages[index]
          }
        );
      });
    }
    const allErrorsUpdated = Object.keys(((_a = props.importDataAndErrors) == null ? void 0 : _a.invalidImportMessages) || {}).filter((index) => !props.updatedIndexes.includes(parseInt(index))).length === 0;
    const invalidPostUpdate = Object.keys(props.postUpdateInvalidImportMessages).length > 0;
    const retryButtonDisabled = !allErrorsUpdated || invalidPostUpdate || loadingImportDataAndErrors || loadingUpdate;
    return /* @__PURE__ */ import_react159.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react159.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Change Imports to Replay Analysis",
        setUIState: props.setUIState,
        notCloseable: true
      }
    ), /* @__PURE__ */ import_react159.default.createElement(DefaultTaskpaneBody_default, null, (props.invalidReplayError === PRE_REPLAY_IMPORT_ERROR_TEXT && !allErrorsUpdated || props.invalidReplayError !== void 0 && props.invalidReplayError !== PRE_REPLAY_IMPORT_ERROR_TEXT) && /* @__PURE__ */ import_react159.default.createElement("p", { className: "text-color-error" }, props.invalidReplayError), updateImportBody), /* @__PURE__ */ import_react159.default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ import_react159.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react159.default.createElement(Col_default, null, /* @__PURE__ */ import_react159.default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "medium",
        onClick: () => {
          overwriteAnalysisToReplayToMitosheetCall(
            props.failedReplayData.analysisName,
            props.analysisData.analysisName,
            props.mitoAPI
          );
          void props.mitoAPI.log("clicked_start_new_analysis_from_pre_replay_update_imports");
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "none" /* NONE */ }
            });
          });
        },
        tooltip: "This will start a new analysis with no steps in this mitosheet."
      },
      "Start New Analysis"
    )), /* @__PURE__ */ import_react159.default.createElement(Col_default, { span: 12 }, /* @__PURE__ */ import_react159.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        onClick: async () => {
          const doUpdate = async () => {
            if (props.updatedStepImportData === void 0) {
              return;
            }
            const _invalidImportIndexes = await props.mitoAPI.getTestImports(props.updatedStepImportData);
            if (_invalidImportIndexes === void 0) {
              return;
            }
            props.setPostUpdateInvalidImportMessages(_invalidImportIndexes);
            void props.mitoAPI.log("clicked_update_from_pre_replay_update_imports");
            void props.mitoAPI.log("get_test_import_results", {
              "num_invalid_imports": Object.keys(_invalidImportIndexes).length,
              "open_due_to_replay_error": true
            });
            if (Object.keys(_invalidImportIndexes).length === 0) {
              props.setInvalidReplayError(void 0);
              const replayAnalysisError = await props.mitoAPI.updateReplayAnalysis(props.failedReplayData.analysisName, props.updatedStepImportData);
              if (isMitoError(replayAnalysisError)) {
                props.setInvalidReplayError(getErrorTextFromToFix(replayAnalysisError.to_fix));
              } else {
                props.setUIState((prevUIState) => {
                  return __spreadProps(__spreadValues({}, prevUIState), {
                    currOpenTaskpane: { type: "none" /* NONE */ },
                    currOpenPopups: __spreadProps(__spreadValues({}, prevUIState.currOpenPopups), {
                      ["top_right" /* TopRight */]: {
                        type: "ephemeral_message" /* EphemeralMessage */,
                        message: "Successfully replayed analysis on new data"
                      }
                    })
                  });
                });
              }
            }
          };
          setLoadingUpdate(true);
          await doUpdate();
          setLoadingUpdate(false);
        },
        disabled: retryButtonDisabled,
        disabledTooltip: retryButtonDisabled ? "Please resolve all errors with above imports." : void 0
      },
      /* @__PURE__ */ import_react159.default.createElement("p", { className: "text-align-center-important" }, !loadingUpdate ? "Retry With Updated Imports" : "Updating Imports...")
    )))));
  };
  var UpdateImportsPreReplayTaskpane_default = UpdateImportsPreReplayTaskpane;

  // src/components/taskpanes/UpdateImports/UpdateSnowflakeCredentialsScreen.tsx
  var import_react162 = __toESM(require_react());

  // src/components/elements/AuthenticateToSnowflakeCard.tsx
  var import_react161 = __toESM(require_react());

  // src/components/elements/LoadingCounter.tsx
  var import_react160 = __toESM(require_react());
  var LoadingCounter = () => {
    const [timeLoading, setTimeLoading] = (0, import_react160.useState)(1);
    (0, import_react160.useEffect)(() => {
      const interval = setInterval(() => {
        setTimeLoading((timeLoading2) => timeLoading2 + 1);
      }, 1e3);
      return () => clearInterval(interval);
    }, []);
    return /* @__PURE__ */ import_react160.default.createElement("span", null, " \xA0( ", timeLoading, "s )");
  };
  var LoadingCounter_default = LoadingCounter;

  // src/components/elements/AuthenticateToSnowflakeCard.tsx
  var getDefaultCredentials = () => {
    return { type: "username/password", username: "", password: "", account: "" };
  };
  var AuthenticateToSnowflakeCard = (props) => {
    const [credentials, setCredentials] = (0, import_react161.useState)(() => props.defaultCredentials || getDefaultCredentials());
    const [snowflakeCredentialsValidityCheckResult, setSnowflakeCredentialsValidityCheckResult] = (0, import_react161.useState)(props.defaultCredentials ? { "type": "success" } : void 0);
    const [loading, setLoading] = (0, import_react161.useState)(false);
    const validateSnowflakeCredentials = async (credentials2) => {
      setLoading(true);
      const credentialsValidityCheckResult = await props.mitoAPI.validateSnowflakeCredentials(credentials2);
      setSnowflakeCredentialsValidityCheckResult(credentialsValidityCheckResult);
      if ((credentialsValidityCheckResult == null ? void 0 : credentialsValidityCheckResult.type) === "success") {
        props.onValidCredentials();
      } else if (props.onInvalidCredentials !== void 0) {
        props.onInvalidCredentials();
      }
      setLoading(false);
    };
    return /* @__PURE__ */ import_react161.default.createElement("div", { className: "mito-collapsible-content-card-container" }, /* @__PURE__ */ import_react161.default.createElement(
      CollapsibleSection_default,
      {
        title: /* @__PURE__ */ import_react161.default.createElement("div", { className: classNames("text-header-3", { "text-color-gray-disabled": loading }) }, "Connection"),
        open: props.isOpen
      },
      /* @__PURE__ */ import_react161.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react161.default.createElement(Col_default, null, /* @__PURE__ */ import_react161.default.createElement("p", { className: classNames({ "text-color-gray-disabled": loading }) }, "Username")), /* @__PURE__ */ import_react161.default.createElement(Col_default, null, /* @__PURE__ */ import_react161.default.createElement(
        Input_default,
        {
          value: credentials.username,
          disabled: loading,
          onChange: (e) => {
            const newUsername = e.target.value;
            setCredentials((prevCredentials) => {
              return updateObjectWithPartialObject(prevCredentials, { username: newUsername });
            });
          }
        }
      ))),
      /* @__PURE__ */ import_react161.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react161.default.createElement(Col_default, null, /* @__PURE__ */ import_react161.default.createElement("p", { className: classNames({ "text-color-gray-disabled": loading }) }, "Password")), /* @__PURE__ */ import_react161.default.createElement(Col_default, null, /* @__PURE__ */ import_react161.default.createElement(
        Input_default,
        {
          value: credentials.password,
          type: "password",
          disabled: loading,
          onChange: (e) => {
            const newPassword = e.target.value;
            setCredentials((prevCredentials) => {
              return updateObjectWithPartialObject(prevCredentials, { password: newPassword });
            });
          }
        }
      ))),
      /* @__PURE__ */ import_react161.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react161.default.createElement(Col_default, null, /* @__PURE__ */ import_react161.default.createElement("p", { className: classNames({ "text-color-gray-disabled": loading }) }, "Account")), /* @__PURE__ */ import_react161.default.createElement(Col_default, null, /* @__PURE__ */ import_react161.default.createElement(
        Input_default,
        {
          value: credentials.account,
          disabled: loading,
          onChange: (e) => {
            const newAccount = e.target.value;
            setCredentials((prevCredentials) => {
              return updateObjectWithPartialObject(prevCredentials, { account: newAccount });
            });
          }
        }
      ))),
      /* @__PURE__ */ import_react161.default.createElement(
        TextButton_default,
        {
          disabled: credentials.username.length === 0 || credentials.password.length === 0 || credentials.account.length === 0 || loading,
          disabledTooltip: "Please fill out the username, password, and account fields below.",
          onClick: async () => {
            await validateSnowflakeCredentials(credentials);
          },
          variant: "dark"
        },
        "Connect to Snowflake"
      )
    ), !loading && snowflakeCredentialsValidityCheckResult !== void 0 && /* @__PURE__ */ import_react161.default.createElement("div", { className: classNames({ "text-color-error": snowflakeCredentialsValidityCheckResult.type === "error", "text-color-success": snowflakeCredentialsValidityCheckResult.type === "success" }, "mito-collapsible-content-card-subtext") }, snowflakeCredentialsValidityCheckResult.type === "success" && "Successfully connected to Snowflake instance.", snowflakeCredentialsValidityCheckResult.type === "error" && snowflakeCredentialsValidityCheckResult.error_message), loading && /* @__PURE__ */ import_react161.default.createElement(Row_default, { suppressTopBottomMargin: true, className: classNames("text-subtext-1", "mito-collapsible-content-card-subtext") }, /* @__PURE__ */ import_react161.default.createElement("p", null, "Connecting to Snowflake"), /* @__PURE__ */ import_react161.default.createElement(LoadingCounter_default, null)));
  };
  var AuthenticateToSnowflakeCard_default = AuthenticateToSnowflakeCard;

  // src/components/taskpanes/UpdateImports/UpdateSnowflakeCredentialsScreen.tsx
  var UpdateSnowflakeCredentialsScreen = (props) => {
    return /* @__PURE__ */ import_react162.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react162.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Connect to Snowflake",
        setUIState: props.setUIState,
        backCallback: props.backCallback,
        notCloseable: props.notCloseable
      }
    ), /* @__PURE__ */ import_react162.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react162.default.createElement(
      AuthenticateToSnowflakeCard_default,
      {
        mitoAPI: props.mitoAPI,
        onValidCredentials: () => props.edit(),
        isOpen: true
      }
    )));
  };
  var UpdateSnowflakeCredentialsScreen_default = UpdateSnowflakeCredentialsScreen;

  // src/components/taskpanes/UpdateImports/UpdateImportsTaskpane.tsx
  var UpdateImportsTaskpane = (props) => {
    const failedReplayData = props.failedReplayData;
    const updatePreReplay = failedReplayData !== void 0;
    const [updatedStepImportData, setUpdatedStepImportData] = (0, import_react163.useState)(void 0);
    const [updatedIndexes, setUpdatedIndexes] = (0, import_react163.useState)([]);
    const [displayedImportCardDropdown, setDisplayedImportCardDropdown] = (0, import_react163.useState)(void 0);
    const [replacingDataframeState, setReplacingDataframeState] = (0, import_react163.useState)(void 0);
    const [postUpdateInvalidImportMessages, setPostUpdateInvalidImportMessages] = (0, import_react163.useState)({});
    const [importDataAndErrors] = useStateFromAPIAsync(
      void 0,
      async () => {
        let importData = void 0;
        let invalidImportIndexes = void 0;
        if (failedReplayData !== void 0) {
          importData = await props.mitoAPI.getImportedFilesAndDataframesFromAnalysisName(failedReplayData.analysisName);
          invalidImportIndexes = await props.mitoAPI.getTestImports(importData || []);
        } else {
          importData = await props.mitoAPI.getImportedFilesAndDataframesFromCurrentSteps();
          invalidImportIndexes = {};
        }
        if (importData !== void 0 && invalidImportIndexes !== void 0) {
          return {
            importData,
            invalidImportMessages: invalidImportIndexes
          };
        }
        return void 0;
      },
      (loadedData) => {
        if (loadedData === void 0) {
          return;
        }
        setUpdatedStepImportData((prevUpdatedStepImportData) => {
          if (prevUpdatedStepImportData === void 0) {
            return window.structuredClone(loadedData.importData);
          }
          return prevUpdatedStepImportData;
        });
        if (failedReplayData !== void 0) {
          if (Object.keys(loadedData.invalidImportMessages).length > 0) {
            setInvalidReplayError(PRE_REPLAY_IMPORT_ERROR_TEXT);
          } else {
            setInvalidReplayError(getErrorTextFromToFix(failedReplayData.error.to_fix));
          }
        }
      },
      []
    );
    const [invalidReplayError, setInvalidReplayError] = (0, import_react163.useState)(void 0);
    (0, import_react163.useEffect)(() => {
      void props.mitoAPI.log("opened_update_imports_taskpane", {
        "open_due_to_replay_error": updatePreReplay,
        "num_invalid_imports": (importDataAndErrors == null ? void 0 : importDataAndErrors.invalidImportMessages) === void 0 ? 0 : Object.keys(importDataAndErrors.invalidImportMessages).length,
        "num_total_imports": (importDataAndErrors == null ? void 0 : importDataAndErrors.importData) === void 0 ? 0 : importDataAndErrors == null ? void 0 : importDataAndErrors.importData.length
      });
    }, [importDataAndErrors]);
    if (replacingDataframeState === void 0) {
      if (props.failedReplayData !== void 0) {
        return /* @__PURE__ */ import_react163.default.createElement(
          UpdateImportsPreReplayTaskpane_default,
          {
            mitoAPI: props.mitoAPI,
            analysisData: props.analysisData,
            setUIState: props.setUIState,
            updatedStepImportData,
            setUpdatedStepImportData,
            updatedIndexes,
            setUpdatedIndexes,
            displayedImportCardDropdown,
            setDisplayedImportCardDropdown,
            setReplacingDataframeState,
            postUpdateInvalidImportMessages,
            setPostUpdateInvalidImportMessages,
            failedReplayData: props.failedReplayData,
            importDataAndErrors,
            invalidReplayError,
            setInvalidReplayError
          }
        );
      } else {
        return /* @__PURE__ */ import_react163.default.createElement(
          UpdateImportsPostReplayTaskpane_default,
          {
            mitoAPI: props.mitoAPI,
            sheetDataArray: props.sheetDataArray,
            setUIState: props.setUIState,
            updatedStepImportData,
            setUpdatedStepImportData,
            updatedIndexes,
            setUpdatedIndexes,
            displayedImportCardDropdown,
            setDisplayedImportCardDropdown,
            setReplacingDataframeState,
            invalidImportMessages: postUpdateInvalidImportMessages,
            setInvalidImportMessages: setPostUpdateInvalidImportMessages,
            importDataAndErrors,
            invalidReplayError,
            setInvalidReplayError
          }
        );
      }
    }
    const importState = replacingDataframeState.importState;
    if (importState.screen === "file_browser") {
      return /* @__PURE__ */ import_react163.default.createElement(
        FileBrowser_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          userProfile: props.userProfile,
          setUIState: props.setUIState,
          isUpdate: true,
          currPathParts: props.currPathParts,
          setCurrPathParts: props.setCurrPathParts,
          setImportState: (newImportState) => {
            setReplacingDataframeState({
              "importState": newImportState,
              "params": void 0,
              "dataframeCreationIndex": replacingDataframeState.dataframeCreationIndex
            });
          },
          importCSVFile: async (file) => {
            const fullPath = [...props.currPathParts];
            fullPath.push(file.name);
            const filePath = await props.mitoAPI.getPathJoined(fullPath);
            if (filePath === void 0) {
              return;
            }
            const dataframeCreationData = {
              "step_type": "simple_import",
              "params": {
                file_names: [filePath]
              }
            };
            const indexToErrorMap = await props.mitoAPI.getTestImports([{
              "step_id": "fake_id",
              "imports": [dataframeCreationData]
            }]);
            if (indexToErrorMap === void 0 || Object.keys(indexToErrorMap).length > 0) {
              setReplacingDataframeState({
                "importState": {
                  "screen": "csv_import_config",
                  "fileName": file.name,
                  "filePath": filePath,
                  "error": indexToErrorMap !== void 0 ? indexToErrorMap[0] : void 0
                },
                "params": void 0,
                "dataframeCreationIndex": replacingDataframeState.dataframeCreationIndex
              });
              return;
            }
            updateDataframeCreation(
              replacingDataframeState.dataframeCreationIndex,
              dataframeCreationData,
              setUpdatedStepImportData,
              setUpdatedIndexes,
              setPostUpdateInvalidImportMessages,
              setReplacingDataframeState
            );
          },
          backCallback: () => {
            setReplacingDataframeState(void 0);
          },
          notCloseable: updatePreReplay
        }
      );
    } else if (importState.screen === "csv_import_config") {
      const params = isCSVImportParams(replacingDataframeState.params) ? replacingDataframeState.params : getDefaultCSVParams(importState.filePath);
      return /* @__PURE__ */ import_react163.default.createElement(
        CSVImportConfigScreen_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          setUIState: props.setUIState,
          isUpdate: true,
          fileName: importState.fileName,
          filePath: importState.filePath,
          params,
          setParams: (updater) => {
            setReplacingDataframeState((prevReplacingDataframeState) => {
              if (prevReplacingDataframeState === void 0) {
                return void 0;
              }
              return __spreadProps(__spreadValues({}, prevReplacingDataframeState), {
                params: updater(params)
              });
            });
          },
          edit: async () => {
            var _a;
            const dataframeCreationData = {
              "step_type": "simple_import",
              "params": params
            };
            const indexToErrorMap = await props.mitoAPI.getTestImports([{
              "step_id": "fake_id",
              "imports": [dataframeCreationData]
            }]);
            if (indexToErrorMap === void 0 || Object.keys(indexToErrorMap).length > 0) {
              const newError = indexToErrorMap !== void 0 ? indexToErrorMap[0] : void 0;
              const finalError = newError && ((_a = importState.error) == null ? void 0 : _a.startsWith(newError)) ? `${importState.error} Still invalid.` : newError;
              setReplacingDataframeState({
                "importState": __spreadProps(__spreadValues({}, importState), {
                  error: finalError
                }),
                "params": void 0,
                "dataframeCreationIndex": replacingDataframeState.dataframeCreationIndex
              });
              return;
            }
            updateDataframeCreation(
              replacingDataframeState.dataframeCreationIndex,
              {
                "step_type": "simple_import",
                "params": params
              },
              setUpdatedStepImportData,
              setUpdatedIndexes,
              setPostUpdateInvalidImportMessages,
              setReplacingDataframeState
            );
          },
          editApplied: false,
          loading: false,
          error: importState.error,
          backCallback: () => {
            setReplacingDataframeState(void 0);
          },
          notCloseable: updatePreReplay
        }
      );
    } else if (replacingDataframeState.importState.screen === "xlsx_import_config") {
      const params = isExcelImportParams(replacingDataframeState.params) ? replacingDataframeState.params : getDefaultXLSXParams(replacingDataframeState.importState.filePath);
      return /* @__PURE__ */ import_react163.default.createElement(
        XLSXImportConfigScreen_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          userProfile: props.userProfile,
          setUIState: props.setUIState,
          isUpdate: true,
          fileName: replacingDataframeState.importState.fileName,
          filePath: replacingDataframeState.importState.filePath,
          params,
          setParams: (updater) => {
            setReplacingDataframeState((prevReplacingDataframeState) => {
              if (prevReplacingDataframeState === void 0) {
                return void 0;
              }
              return __spreadProps(__spreadValues({}, prevReplacingDataframeState), {
                params: updater(params)
              });
            });
          },
          edit: () => {
            updateDataframeCreation(
              replacingDataframeState.dataframeCreationIndex,
              {
                "step_type": "excel_import",
                "params": params
              },
              setUpdatedStepImportData,
              setUpdatedIndexes,
              setPostUpdateInvalidImportMessages,
              setReplacingDataframeState
            );
          },
          editApplied: false,
          loading: false,
          backCallback: () => {
            setReplacingDataframeState(void 0);
          },
          notCloseable: updatePreReplay
        }
      );
    } else if (replacingDataframeState.importState.screen === "authenticate_to_snowflake") {
      return /* @__PURE__ */ import_react163.default.createElement(
        UpdateSnowflakeCredentialsScreen_default,
        {
          mitoAPI: props.mitoAPI,
          setUIState: props.setUIState,
          edit: () => {
            updateAllSnowflakeImports(
              updatedStepImportData,
              setUpdatedStepImportData,
              setUpdatedIndexes,
              setPostUpdateInvalidImportMessages,
              setReplacingDataframeState
            );
          },
          backCallback: () => {
            setReplacingDataframeState(void 0);
          },
          notCloseable: updatePreReplay
        }
      );
    } else {
      const params = isDataframeImportParams(replacingDataframeState.params) ? replacingDataframeState.params : { df_names: [] };
      return /* @__PURE__ */ import_react163.default.createElement(
        UpdateDataframeImportTaskpane_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          setUIState: props.setUIState,
          isUpdate: true,
          params,
          setParams: (updater) => {
            setReplacingDataframeState((prevReplacingDataframeState) => {
              if (prevReplacingDataframeState === void 0) {
                return void 0;
              }
              return __spreadProps(__spreadValues({}, prevReplacingDataframeState), {
                params: updater(params)
              });
            });
          },
          edit: () => {
            updateDataframeCreation(
              replacingDataframeState.dataframeCreationIndex,
              {
                "step_type": "dataframe_import",
                "params": params
              },
              setUpdatedStepImportData,
              setUpdatedIndexes,
              setPostUpdateInvalidImportMessages,
              setReplacingDataframeState
            );
          },
          backCallback: () => {
            setReplacingDataframeState(void 0);
          },
          notCloseable: updatePreReplay
        }
      );
    }
  };
  var UpdateImportsTaskpane_default = UpdateImportsTaskpane;

  // src/components/taskpanes/CannotCreateComm/CannotCreateCommTaskpane.tsx
  var import_react164 = __toESM(require_react());
  var CannotCreateCommTaskpane = (props) => {
    let header = "";
    let firstLine = "";
    let secondLine = "";
    if (props.commCreationErrorStatus === "no_backend_comm_registered_error") {
      header = "Rerun Cell Above";
      firstLine = "Looks like you restarted your kernel.";
      secondLine = /* @__PURE__ */ import_react164.default.createElement(import_react164.default.Fragment, null, "Rerun the ", /* @__PURE__ */ import_react164.default.createElement("code", null, "mitosheet.sheet()"), " call above to refresh this mitosheet.");
    } else if (props.commCreationErrorStatus === "non_valid_location_error") {
      header = "Unsupported Enviornment";
      firstLine = "Mito only supports JupyterLab and Jupyter Notebook, not wherever this is.";
      secondLine = /* @__PURE__ */ import_react164.default.createElement(import_react164.default.Fragment, null, "To install Mito in JupyterLab and Jupyter Notebook, follow our ", /* @__PURE__ */ import_react164.default.createElement("a", { href: DOCUMENTATION_LINK_INSTALL, target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ import_react164.default.createElement("span", { className: "text-body-1-link" }, "installation instructions.")));
    } else if (props.commCreationErrorStatus === "non_working_extension_error") {
      header = "Invalid installation";
      firstLine = "Try restarting your JupyterLab. Mito was unable to connect to your Python kernel.";
      secondLine = /* @__PURE__ */ import_react164.default.createElement(import_react164.default.Fragment, null, "If this does not resolve this error, please ensure you have followed our ", /* @__PURE__ */ import_react164.default.createElement("a", { href: DOCUMENTATION_LINK_INSTALL, target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ import_react164.default.createElement("span", { className: "text-body-1-link" }, "installation instructions.")));
    }
    return /* @__PURE__ */ import_react164.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react164.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header,
        setUIState: props.setUIState,
        notCloseable: true
      }
    ), /* @__PURE__ */ import_react164.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react164.default.createElement("p", null, firstLine), /* @__PURE__ */ import_react164.default.createElement(Spacer_default, { px: 15 }), /* @__PURE__ */ import_react164.default.createElement("p", null, secondLine), /* @__PURE__ */ import_react164.default.createElement(Spacer_default, { px: 15 }), /* @__PURE__ */ import_react164.default.createElement("p", null, "If you are still receiving this error message, join our slack to get support!"), /* @__PURE__ */ import_react164.default.createElement(Spacer_default, { px: 15 }), /* @__PURE__ */ import_react164.default.createElement(GetSupportButton_default, { userProfile: props.userProfile, setUIState: props.setUIState, width: "block" })));
  };
  var CannotCreateCommTaskpane_default = CannotCreateCommTaskpane;

  // src/components/taskpanes/CodeSnippets/CodeSnippetsTaskpane.tsx
  var import_react167 = __toESM(require_react());

  // src/components/icons/DropdownIcon.tsx
  var import_react165 = __toESM(require_react());
  var DropdownIcon = () => {
    return /* @__PURE__ */ import_react165.default.createElement("svg", { width: "20", height: "16", viewBox: "0 0 4 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react165.default.createElement("circle", { cx: "2", cy: "2", r: "2", fill: "#343434" }), /* @__PURE__ */ import_react165.default.createElement("circle", { cx: "2", cy: "8", r: "2", fill: "#343434" }), /* @__PURE__ */ import_react165.default.createElement("circle", { cx: "2", cy: "14", r: "2", fill: "#343434" }));
  };
  var DropdownIcon_default = DropdownIcon;

  // src/components/icons/CodeSnippetIcon.tsx
  var import_react166 = __toESM(require_react());
  var CodeSnippetIcon = () => {
    return /* @__PURE__ */ import_react166.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 13 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react166.default.createElement("line", { y1: "1", x2: "13", y2: "1", stroke: "#494650" }), /* @__PURE__ */ import_react166.default.createElement("line", { y1: "5", x2: "13", y2: "5", stroke: "#494650" }), /* @__PURE__ */ import_react166.default.createElement("line", { y1: "9", x2: "13", y2: "9", stroke: "#494650" }), /* @__PURE__ */ import_react166.default.createElement("line", { y1: "13", x2: "13", y2: "13", stroke: "#494650" }));
  };
  var CodeSnippetIcon_default = CodeSnippetIcon;

  // src/components/taskpanes/CodeSnippets/CodeSnippetsTaskpane.tsx
  var CONFIRMATION_TEXT_COPIED = "Copied code snippet to clipboard. Paste it in a code cell below.";
  var CONFIRMATION_TEXT_CODE_WRITTEN = "Code snippet written to code cell below. Scroll down to see it.";
  var CodeSnippetsTaskpane = (props) => {
    const [codeSnippetAPIResult] = useStateFromAPIAsync(void 0, () => {
      return props.mitoAPI.getCodeSnippets();
    }, void 0, []);
    const [searchString, setSearchString] = (0, import_react167.useState)("");
    const [openDropdownIndex, setOpenDropdownIndex] = (0, import_react167.useState)(void 0);
    const [confirmationText, setConfirmationText] = (0, import_react167.useState)(void 0);
    useDebouncedEffect(() => {
      if (confirmationText !== void 0) {
        setConfirmationText(void 0);
      }
    }, [confirmationText], 3e3);
    if ((codeSnippetAPIResult == null ? void 0 : codeSnippetAPIResult.status) === "error") {
      return /* @__PURE__ */ import_react167.default.createElement(
        DefaultEmptyTaskpane_default,
        {
          setUIState: props.setUIState,
          header: "Error loading code snippets",
          message: codeSnippetAPIResult.error_message,
          errorMessage: true,
          suppressImportLink: true
        }
      );
    }
    const codeSnippetsToDisplay = codeSnippetAPIResult == null ? void 0 : codeSnippetAPIResult.code_snippets.filter((codeSnippet) => {
      return fuzzyMatch(codeSnippet.Name, searchString) > 0.75 || fuzzyMatch(codeSnippet.Description, searchString) > 0.75 || fuzzyMatch(codeSnippet.Code.join(" "), searchString) > 0.75;
    });
    return /* @__PURE__ */ import_react167.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react167.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Code Snippets",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react167.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react167.default.createElement(
      Input_default,
      {
        value: searchString,
        onChange: (e) => {
          setSearchString(e.target.value);
        },
        placeholder: "Search for a code snippet by name or content"
      }
    ), confirmationText !== void 0 && /* @__PURE__ */ import_react167.default.createElement("p", { className: "text-color-success" }, confirmationText), codeSnippetsToDisplay == null ? void 0 : codeSnippetsToDisplay.map((codeSnippet, codeSnippetIndex) => {
      var _a;
      const copyToClipboard = () => {
        setConfirmationText(CONFIRMATION_TEXT_COPIED);
        void writeTextToClipboard(codeSnippet.Code.join("\n"));
        void props.mitoAPI.log("code_snippet_copied", { "code_snippet_name": codeSnippet.Name });
      };
      const writeToCell2 = () => {
        setConfirmationText(CONFIRMATION_TEXT_CODE_WRITTEN);
        writeCodeSnippetCell(props.analysisData.analysisName, codeSnippet.Code.join("\n"));
        void props.mitoAPI.log("code_snippet_written_to_cell", { "code_snippet_name": codeSnippet.Name });
      };
      let openLocation = DISCORD_INVITE_LINK;
      const codeSnippetSupportEmail = (_a = props.userProfile.mitoConfig.MITO_CONFIG_CODE_SNIPPETS) == null ? void 0 : _a.MITO_CONFIG_CODE_SNIPPETS_SUPPORT_EMAIL;
      if (codeSnippetSupportEmail !== void 0 && codeSnippetSupportEmail !== null) {
        openLocation = `mailto:${codeSnippetSupportEmail}?subject=Mito Code Snippet Support: ID ${codeSnippet.Id}`;
      }
      return /* @__PURE__ */ import_react167.default.createElement(
        Row_default,
        {
          key: codeSnippetIndex,
          align: "center",
          className: classNames("highlight-on-hover", DROPDOWN_IGNORE_CLICK_CLASS),
          justify: "space-between",
          onClick: () => {
            setOpenDropdownIndex((prevOpenDropdownIndex) => {
              if (prevOpenDropdownIndex === codeSnippetIndex) {
                return void 0;
              }
              return codeSnippetIndex;
            });
          }
        },
        /* @__PURE__ */ import_react167.default.createElement(Col_default, { offsetRight: 0.5 }, /* @__PURE__ */ import_react167.default.createElement(CodeSnippetIcon_default, null)),
        /* @__PURE__ */ import_react167.default.createElement(Col_default, { span: 20 }, /* @__PURE__ */ import_react167.default.createElement("div", { className: "text-bold" }, codeSnippet.Name), /* @__PURE__ */ import_react167.default.createElement("div", { className: "text-overflow-wrap pb-5px" }, codeSnippet.Description)),
        /* @__PURE__ */ import_react167.default.createElement(
          Col_default,
          {
            offset: 2
          },
          /* @__PURE__ */ import_react167.default.createElement(DropdownIcon_default, null)
        ),
        /* @__PURE__ */ import_react167.default.createElement(Col_default, null, /* @__PURE__ */ import_react167.default.createElement(
          Dropdown_default,
          {
            display: codeSnippetIndex === openDropdownIndex,
            width: "medium",
            closeDropdown: () => {
              setOpenDropdownIndex(void 0);
            }
          },
          /* @__PURE__ */ import_react167.default.createElement(
            DropdownItem_default,
            {
              title: "Copy Code Snippet",
              onClick: copyToClipboard
            }
          ),
          /* @__PURE__ */ import_react167.default.createElement(
            DropdownItem_default,
            {
              title: "Write to Notebook",
              onClick: writeToCell2
            }
          ),
          /* @__PURE__ */ import_react167.default.createElement(
            DropdownItem_default,
            {
              title: "Get Support",
              onClick: () => {
                var _a2;
                window.open(openLocation);
                void ((_a2 = props.mitoAPI) == null ? void 0 : _a2.log("clicked_code_snippet_get_support_button"));
              }
            }
          )
        ))
      );
    }), codeSnippetAPIResult === void 0 && /* @__PURE__ */ import_react167.default.createElement("p", { className: "mt-20px" }, "Loading code snippets ", /* @__PURE__ */ import_react167.default.createElement(LoadingDots_default, null))));
  };
  var CodeSnippetsTaskpane_default = CodeSnippetsTaskpane;

  // src/components/taskpanes/SnowflakeImport/SnowflakeImportTaskpane.tsx
  var import_react168 = __toESM(require_react());
  var LIMIT_TOOLTIP = "Used to specify the number of rows to return. When working with large datasets, it might be helpful to begin with a subset of your data.";
  var getDefaultParams7 = () => {
    return {
      table_loc_and_warehouse: { warehouse: void 0, database: void 0, schema: void 0, table: void 0 },
      query_params: { columns: [], limit: void 0 }
    };
  };
  var getNewParams = (prevParams, database, schema, table) => {
    const paramsCopy = window.structuredClone(prevParams);
    const newParams = __spreadProps(__spreadValues({}, paramsCopy), {
      "table_loc_and_warehouse": __spreadProps(__spreadValues({}, paramsCopy.table_loc_and_warehouse), {
        "database": database,
        "schema": schema,
        "table": table
      }),
      "query_params": {
        "columns": [],
        "limit": void 0
      }
    });
    if (JSON.stringify(newParams) === JSON.stringify(prevParams)) {
      return prevParams;
    }
    return newParams;
  };
  var SnowflakeImportTaskpane = (props) => {
    var _a;
    const { params, setParams: setParamsWithoutRefreshOptionsAndDefaults, edit, loading: executingQuery, error } = useSendEditOnClick_default(
      () => getDefaultParams7(),
      "snowflake_import" /* SnowflakeImport */,
      props.mitoAPI,
      props.analysisData,
      void 0,
      (newParams) => {
        if (newParams !== void 0) {
          void loadAndSetOptionsAndDefaults(newParams);
        }
      }
    );
    const [validCredentials, setValidCredentials] = (0, import_react168.useState)(props.userProfile.snowflakeCredentials !== null);
    const [credentialsSectionIsOpen, setCredentialsSectionIsOpen] = (0, import_react168.useState)(props.userProfile.snowflakeCredentials === null);
    const [availableSnowflakeOptionsAndDefaults, setAvailableSnowflakeOptionsAndDefaults] = (0, import_react168.useState)(void 0);
    const [loadingAvailableOptionsAndDefaults, setLoadingAvailableOptionsAndDefaults] = (0, import_react168.useState)(false);
    (0, import_react168.useEffect)(() => {
      if (props.userProfile.snowflakeCredentials !== null && params !== void 0) {
        void loadAndSetOptionsAndDefaults(params);
      }
    }, []);
    const setParamsAndRefreshOptionsAndDefaults = (newParams) => {
      setParamsWithoutRefreshOptionsAndDefaults(newParams);
      void loadAndSetOptionsAndDefaults(newParams);
    };
    if (params === void 0) {
      return /* @__PURE__ */ import_react168.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    const loadAndSetOptionsAndDefaults = async (newParams) => {
      setLoadingAvailableOptionsAndDefaults(true);
      const availableSnowflakeOptionsAndDefaults2 = await props.mitoAPI.getAvailableSnowflakeOptionsAndDefaults(newParams.table_loc_and_warehouse);
      setAvailableSnowflakeOptionsAndDefaults(availableSnowflakeOptionsAndDefaults2);
      if ((availableSnowflakeOptionsAndDefaults2 == null ? void 0 : availableSnowflakeOptionsAndDefaults2.type) === "success") {
        setParamsWithoutRefreshOptionsAndDefaults((prevParams) => {
          return __spreadProps(__spreadValues({}, prevParams), {
            table_loc_and_warehouse: availableSnowflakeOptionsAndDefaults2.default_values
          });
        });
      }
      setLoadingAvailableOptionsAndDefaults(false);
    };
    return /* @__PURE__ */ import_react168.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react168.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Import from Snowflake",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react168.default.createElement(DefaultTaskpaneBody_default, { userProfile: props.userProfile, requiresPro: true }, /* @__PURE__ */ import_react168.default.createElement(
      AuthenticateToSnowflakeCard_default,
      {
        mitoAPI: props.mitoAPI,
        defaultCredentials: props.userProfile.snowflakeCredentials,
        onValidCredentials: () => {
          setCredentialsSectionIsOpen(false);
          setValidCredentials(true);
          void loadAndSetOptionsAndDefaults(params);
        },
        onInvalidCredentials: () => {
          setValidCredentials(false);
          setParamsWithoutRefreshOptionsAndDefaults(getDefaultParams7());
          setAvailableSnowflakeOptionsAndDefaults(void 0);
        },
        isOpen: credentialsSectionIsOpen
      }
    ), /* @__PURE__ */ import_react168.default.createElement(Spacer_default, { px: 20 }), /* @__PURE__ */ import_react168.default.createElement(
      CollapsibleSection_default,
      {
        title: /* @__PURE__ */ import_react168.default.createElement("div", { className: classNames("text-header-3", { "text-color-gray-disabled": loadingAvailableOptionsAndDefaults }) }, "Configure Query"),
        open: (availableSnowflakeOptionsAndDefaults == null ? void 0 : availableSnowflakeOptionsAndDefaults.type) === "success"
      },
      /* @__PURE__ */ import_react168.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react168.default.createElement(Col_default, null, /* @__PURE__ */ import_react168.default.createElement("p", { className: classNames({ "text-color-gray-disabled": loadingAvailableOptionsAndDefaults }) }, "Warehouse")), /* @__PURE__ */ import_react168.default.createElement(Col_default, null, /* @__PURE__ */ import_react168.default.createElement(
        Select_default,
        {
          width: "medium",
          value: params.table_loc_and_warehouse.warehouse || "None available",
          disabled: loadingAvailableOptionsAndDefaults,
          onChange: (newWarehouse) => {
            setParamsWithoutRefreshOptionsAndDefaults((prevParams) => {
              return updateObjectWithPartialObject(prevParams, { table_loc_and_warehouse: { warehouse: newWarehouse } });
            });
          }
        },
        (availableSnowflakeOptionsAndDefaults == null ? void 0 : availableSnowflakeOptionsAndDefaults.type) === "success" ? availableSnowflakeOptionsAndDefaults.config_options.warehouses.map((warehouse) => {
          return /* @__PURE__ */ import_react168.default.createElement(DropdownItem_default, { key: warehouse, id: warehouse, title: warehouse });
        }) : []
      ))),
      /* @__PURE__ */ import_react168.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react168.default.createElement(Col_default, null, /* @__PURE__ */ import_react168.default.createElement("p", { className: classNames({ "text-color-gray-disabled": loadingAvailableOptionsAndDefaults }) }, "Database")), /* @__PURE__ */ import_react168.default.createElement(Col_default, null, /* @__PURE__ */ import_react168.default.createElement(
        Select_default,
        {
          width: "medium",
          value: params.table_loc_and_warehouse.database || "None available",
          disabled: loadingAvailableOptionsAndDefaults,
          onChange: (newDatabase) => {
            const newParams = getNewParams(params, newDatabase);
            setParamsAndRefreshOptionsAndDefaults(newParams);
          }
        },
        (availableSnowflakeOptionsAndDefaults == null ? void 0 : availableSnowflakeOptionsAndDefaults.type) === "success" ? availableSnowflakeOptionsAndDefaults.config_options.databases.map((database) => {
          return /* @__PURE__ */ import_react168.default.createElement(DropdownItem_default, { key: database, id: database, title: database });
        }) : []
      ))),
      /* @__PURE__ */ import_react168.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react168.default.createElement(Col_default, null, /* @__PURE__ */ import_react168.default.createElement("p", { className: classNames({ "text-color-gray-disabled": loadingAvailableOptionsAndDefaults }) }, "Schema")), /* @__PURE__ */ import_react168.default.createElement(Col_default, null, /* @__PURE__ */ import_react168.default.createElement(
        Select_default,
        {
          width: "medium",
          value: params.table_loc_and_warehouse.schema || "None available",
          disabled: loadingAvailableOptionsAndDefaults,
          onChange: (newSchema) => {
            const newParams = getNewParams(params, params.table_loc_and_warehouse.database, newSchema);
            setParamsAndRefreshOptionsAndDefaults(newParams);
          }
        },
        (availableSnowflakeOptionsAndDefaults == null ? void 0 : availableSnowflakeOptionsAndDefaults.type) === "success" ? availableSnowflakeOptionsAndDefaults.config_options.schemas.map((schema) => {
          return /* @__PURE__ */ import_react168.default.createElement(DropdownItem_default, { key: schema, id: schema, title: schema });
        }) : []
      ))),
      /* @__PURE__ */ import_react168.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react168.default.createElement(Col_default, null, /* @__PURE__ */ import_react168.default.createElement("p", { className: classNames({ "text-color-gray-disabled": loadingAvailableOptionsAndDefaults }) }, "Table")), /* @__PURE__ */ import_react168.default.createElement(Col_default, null, /* @__PURE__ */ import_react168.default.createElement(
        Select_default,
        {
          width: "medium",
          value: params.table_loc_and_warehouse.table || "None available",
          disabled: loadingAvailableOptionsAndDefaults,
          onChange: (newTable) => {
            const newParams = getNewParams(params, params.table_loc_and_warehouse.database, params.table_loc_and_warehouse.schema, newTable);
            setParamsAndRefreshOptionsAndDefaults(newParams);
          }
        },
        (availableSnowflakeOptionsAndDefaults == null ? void 0 : availableSnowflakeOptionsAndDefaults.type) === "success" ? availableSnowflakeOptionsAndDefaults.config_options.tables.map((table) => {
          return /* @__PURE__ */ import_react168.default.createElement(DropdownItem_default, { key: table, id: table, title: table });
        }) : []
      ))),
      loadingAvailableOptionsAndDefaults && /* @__PURE__ */ import_react168.default.createElement(Row_default, { className: classNames("text-subtext-1") }, /* @__PURE__ */ import_react168.default.createElement("p", null, "Loading Snowflake options"), /* @__PURE__ */ import_react168.default.createElement(LoadingCounter_default, null))
    ), (availableSnowflakeOptionsAndDefaults == null ? void 0 : availableSnowflakeOptionsAndDefaults.type) === "success" && /* @__PURE__ */ import_react168.default.createElement("div", null, /* @__PURE__ */ import_react168.default.createElement(Row_default, { justify: "start" }, /* @__PURE__ */ import_react168.default.createElement("p", { className: "text-header-3" }, "Columns to Import")), /* @__PURE__ */ import_react168.default.createElement(
      MultiToggleBox_default,
      {
        disabled: loadingAvailableOptionsAndDefaults,
        height: "medium",
        onToggleAll: (newSelectedIndexes) => {
          setParamsWithoutRefreshOptionsAndDefaults((prevParams) => {
            const newColumns = newSelectedIndexes.map((index) => availableSnowflakeOptionsAndDefaults.config_options.columns[index]);
            return updateObjectWithPartialObject(prevParams, { query_params: { columns: newColumns } });
          });
        }
      },
      availableSnowflakeOptionsAndDefaults.config_options.columns.map((column, index) => {
        const isToggled = params.query_params.columns.includes(column);
        return /* @__PURE__ */ import_react168.default.createElement(
          MultiToggleItem_default,
          {
            key: column,
            title: column,
            toggled: isToggled,
            onToggle: () => {
              setParamsWithoutRefreshOptionsAndDefaults((prevParams) => {
                const newColumns = [...prevParams.query_params.columns];
                toggleInArray(newColumns, column);
                return updateObjectWithPartialObject(prevParams, { query_params: { columns: newColumns } });
              });
            },
            index
          }
        );
      })
    ), /* @__PURE__ */ import_react168.default.createElement(Row_default, { justify: "space-between", align: "center", title: LIMIT_TOOLTIP }, /* @__PURE__ */ import_react168.default.createElement(Col_default, null, /* @__PURE__ */ import_react168.default.createElement(LabelAndTooltip_default, { tooltip: LIMIT_TOOLTIP }, "Limit")), /* @__PURE__ */ import_react168.default.createElement(Col_default, null, /* @__PURE__ */ import_react168.default.createElement(
      Input_default,
      {
        width: "medium",
        value: ((_a = params.query_params.limit) == null ? void 0 : _a.toString()) || "",
        placeholder: "100000",
        disabled: loadingAvailableOptionsAndDefaults,
        onChange: (e) => {
          let newLimitNumber = parseInt(e.target.value);
          if (isNaN(newLimitNumber)) {
            newLimitNumber = void 0;
          }
          setParamsWithoutRefreshOptionsAndDefaults((prevParams) => {
            return updateObjectWithPartialObject(prevParams, { query_params: { limit: newLimitNumber } });
          });
        }
      }
    ))), executingQuery && /* @__PURE__ */ import_react168.default.createElement(Row_default, { className: classNames("text-subtext-1") }, /* @__PURE__ */ import_react168.default.createElement("p", null, "Executing query"), /* @__PURE__ */ import_react168.default.createElement(LoadingCounter_default, null)), error !== void 0 && /* @__PURE__ */ import_react168.default.createElement("p", { className: "text-color-error" }, error)), /* @__PURE__ */ import_react168.default.createElement(Row_default, null, /* @__PURE__ */ import_react168.default.createElement(
      TextButton_default,
      {
        disabled: !validCredentials || params.table_loc_and_warehouse.warehouse === void 0 || params.table_loc_and_warehouse.database === void 0 || params.table_loc_and_warehouse.schema === void 0 || params.table_loc_and_warehouse.table === void 0 || params.query_params.columns.length === 0,
        disabledTooltip: "Fill out all required fields",
        onClick: () => edit(),
        variant: "dark"
      },
      "Run Query"
    ))));
  };
  var SnowflakeImportTaskpane_default = SnowflakeImportTaskpane;

  // src/components/taskpanes/ExcelRangeImport/ExcelRangeImportTaskpane.tsx
  var import_react169 = __toESM(require_react());
  var getDefaultParams8 = (file_path, sheet_name) => {
    return {
      file_path,
      sheet_name,
      range_imports: [{ "type": "range", "df_name": "", "value": "" }]
    };
  };
  var ExcelRangeImportTaskpane = (props) => {
    const { params, setParams, edit, error } = useSendEditOnClick_default(
      () => getDefaultParams8(props.file_path, props.sheet_name),
      "excel_range_import" /* ExcelRangeImport */,
      props.mitoAPI,
      props.analysisData,
      { overwiteStepIfClickedMultipleTimes: true }
    );
    const [expandedIndex, setExpandedIndex] = (0, import_react169.useState)(0);
    if (params === void 0) {
      return /* @__PURE__ */ import_react169.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    let disabledTooltip = void 0;
    if (params.range_imports.length === 0) {
      disabledTooltip = "Please add range imports above before importing them.";
    } else {
      params.range_imports.forEach((rangeImport) => {
        if (rangeImport.df_name === "") {
          disabledTooltip = "Please ensure all range imports have a defined dataframe name.";
        } else if (rangeImport.value === "") {
          if (rangeImport.type === "range") {
            disabledTooltip = "Please ensure all range imports have a defined range.";
          } else {
            disabledTooltip = "Please ensure all range imports have a defined Exact Cell Value.";
          }
        }
      });
    }
    return /* @__PURE__ */ import_react169.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react169.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Excel Range Import",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react169.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react169.default.createElement("p", { className: "text-body-3 text-overflow-wrap" }, "Import ranges from ", /* @__PURE__ */ import_react169.default.createElement("span", { className: "text-bold" }, props.sheet_name), " in ", /* @__PURE__ */ import_react169.default.createElement("span", { className: "text-bold" }, getBaseOfPath(props.file_path)), "."), /* @__PURE__ */ import_react169.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react169.default.createElement(Col_default, null, /* @__PURE__ */ import_react169.default.createElement("p", { className: "text-header-3" }, "Range Imports")), /* @__PURE__ */ import_react169.default.createElement(Col_default, { span: 4 }, /* @__PURE__ */ import_react169.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        onClick: () => {
          setParams((prevParams) => {
            const newRangeImports = window.structuredClone(prevParams.range_imports);
            const previousType = newRangeImports.length > 0 ? newRangeImports[0].type : "range";
            newRangeImports.unshift({ "type": previousType, "df_name": "", "value": "" });
            return __spreadProps(__spreadValues({}, prevParams), {
              range_imports: newRangeImports
            });
          });
          setExpandedIndex(0);
        },
        width: "block"
      },
      "+ Add"
    ))), error !== void 0 && /* @__PURE__ */ import_react169.default.createElement("p", { className: "text-color-error" }, error), params.range_imports.map((range_import, index) => {
      return /* @__PURE__ */ import_react169.default.createElement(
        ExpandableContentCard_default,
        {
          key: index,
          title: range_import.df_name === "" ? "Unnamed dataframe" : `Importing ${range_import.df_name}`,
          subtitle: range_import.value === "" ? "Unselected Range" : `Range ${range_import.value}`,
          expandedTitle: "Edit Range Import",
          isExpanded: index === expandedIndex,
          setExpanded: (newIsExpanded) => {
            if (newIsExpanded) {
              setExpandedIndex(index);
            } else {
              setExpandedIndex(-1);
            }
          },
          onDelete: () => {
            setParams((prevParams) => {
              const newRangeImports = window.structuredClone(prevParams.range_imports);
              newRangeImports.splice(index, 1);
              return __spreadProps(__spreadValues({}, prevParams), {
                range_imports: newRangeImports
              });
            });
            if (expandedIndex >= index) {
              setExpandedIndex(expandedIndex - 1);
            }
          }
        },
        /* @__PURE__ */ import_react169.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react169.default.createElement(Col_default, null, /* @__PURE__ */ import_react169.default.createElement("p", null, "Dataframe Name")), /* @__PURE__ */ import_react169.default.createElement(Col_default, null, /* @__PURE__ */ import_react169.default.createElement(
          Input_default,
          {
            width: "medium",
            autoFocus: true,
            placeholder: "company_ids",
            value: range_import.df_name,
            onChange: (e) => {
              const newDfName = e.target.value;
              setParams((prevParams) => {
                const newRangeImports = window.structuredClone(prevParams.range_imports);
                newRangeImports[index].df_name = newDfName;
                return __spreadProps(__spreadValues({}, prevParams), {
                  range_imports: newRangeImports
                });
              });
            }
          }
        ))),
        /* @__PURE__ */ import_react169.default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ import_react169.default.createElement(Col_default, null, /* @__PURE__ */ import_react169.default.createElement("p", null, "Locate Dataframe By")), /* @__PURE__ */ import_react169.default.createElement(Col_default, null, /* @__PURE__ */ import_react169.default.createElement(
          Select_default,
          {
            width: "medium",
            value: range_import.type,
            onChange: (newType) => {
              setParams((prevParams) => {
                const isNew = prevParams.range_imports[index].type !== newType;
                const newRangeImports = window.structuredClone(prevParams.range_imports);
                newRangeImports[index].type = newType;
                if (isNew) {
                  newRangeImports[index].value = "";
                }
                return __spreadProps(__spreadValues({}, prevParams), {
                  range_imports: newRangeImports
                });
              });
            }
          },
          /* @__PURE__ */ import_react169.default.createElement(
            DropdownItem_default,
            {
              title: "Exact Range",
              id: "range",
              subtext: "Specify the exact range to import as a sheet."
            }
          ),
          /* @__PURE__ */ import_react169.default.createElement(
            DropdownItem_default,
            {
              title: "Upper Left Corner",
              id: "upper left corner value",
              subtext: "Give the value in the upper left corner of the table to import, and Mito will automatically determine the bounds of the table."
            }
          )
        ))),
        /* @__PURE__ */ import_react169.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react169.default.createElement(Col_default, null, /* @__PURE__ */ import_react169.default.createElement(
          LabelAndTooltip_default,
          {
            textBody: true,
            tooltip: range_import.type === "range" ? "The proper format is COLUMNROW:COLUMNROW. For example, A1:B10, C10:G1000." : "Mito will attempt to find the cell with this exact value. Only strings and numbers are supported currently."
          },
          range_import.type === "range" ? "Excel Range" : "Exact Cell Value"
        )), /* @__PURE__ */ import_react169.default.createElement(Col_default, null, /* @__PURE__ */ import_react169.default.createElement(
          Input_default,
          {
            width: "medium",
            placeholder: range_import.type === "range" ? "A10:C100" : "id_abc123",
            value: "" + range_import.value,
            onChange: (e) => {
              const newValue = e.target.value;
              setParams((prevParams) => {
                const newRangeImports = window.structuredClone(prevParams.range_imports);
                const newRangeImport = newRangeImports[index];
                newRangeImport.value = newValue;
                return __spreadProps(__spreadValues({}, prevParams), {
                  range_imports: newRangeImports
                });
              });
            }
          }
        )))
      );
    })), /* @__PURE__ */ import_react169.default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ import_react169.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          edit((params2) => {
            const finalRangeImports = params2.range_imports.map((rangeImport) => {
              if (rangeImport.type === "upper left corner value" && typeof rangeImport.value === "string") {
                const parsedValue = parseFloat(rangeImport.value);
                if (!isNaN(parsedValue)) {
                  return __spreadProps(__spreadValues({}, rangeImport), {
                    value: parsedValue
                  });
                }
              }
              return rangeImport;
            });
            finalRangeImports.reverse();
            return __spreadProps(__spreadValues({}, params2), {
              range_imports: finalRangeImports
            });
          });
        },
        disabled: disabledTooltip !== void 0,
        disabledTooltip
      },
      "Import Ranges"
    )));
  };
  var ExcelRangeImportTaskpane_default = ExcelRangeImportTaskpane;

  // src/components/taskpanes/ExportToFile/ExportToFileTaskpane.tsx
  var import_react170 = __toESM(require_react());
  var getDefaultParams9 = (sheetDataArray2, sheetIndex) => {
    if (sheetDataArray2.length === 0 || sheetDataArray2[sheetIndex] === void 0) {
      return void 0;
    }
    const sheetName = sheetDataArray2[sheetIndex].dfName;
    return {
      type: "csv",
      sheet_indexes: [sheetIndex],
      file_name: `${sheetName}_export`
    };
  };
  var INVALID_CHARACTERS_IN_FILENAME = [
    "\\",
    "/",
    "<",
    ">",
    ":",
    '"',
    "|",
    "?",
    "*"
  ];
  var ExportToFileTaskpane = (props) => {
    const { params, setParams, edit, editApplied, loading } = useSendEditOnClick_default(
      () => getDefaultParams9(props.sheetDataArray, props.selectedSheetIndex),
      "export_to_file" /* ExportToFile */,
      props.mitoAPI,
      props.analysisData
    );
    if (params === void 0) {
      return /* @__PURE__ */ import_react170.default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState, message: "Please import a dataframe before attempting to export it" });
    }
    let invalidFileNameWarning = void 0;
    if (params.type === "csv" && params.file_name.endsWith(".xlsx")) {
      invalidFileNameWarning = "The .xlsx file extension does not match the CSV File Type.";
    } else if (params.type === "excel" && (params.file_name.endsWith(".txt") || params.file_name.endsWith(".csv"))) {
      invalidFileNameWarning = "The file extension ending does not match the Excel file type.";
    }
    INVALID_CHARACTERS_IN_FILENAME.forEach((char) => {
      if (params.file_name.includes(char)) {
        invalidFileNameWarning = `The File Name cannot include ${char}`;
      }
    });
    return /* @__PURE__ */ import_react170.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react170.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Export To File",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react170.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react170.default.createElement(Row_default, { justify: "space-between", align: "center", title: "TODO" }, /* @__PURE__ */ import_react170.default.createElement(Col_default, null, /* @__PURE__ */ import_react170.default.createElement("p", { className: "text-header-3" }, "File Name")), /* @__PURE__ */ import_react170.default.createElement(Col_default, null, /* @__PURE__ */ import_react170.default.createElement(
      Input_default,
      {
        autoFocus: true,
        placeholder: "MitoExport",
        width: "medium",
        value: "" + params.file_name,
        onChange: (e) => {
          const newValue = e.target.value;
          setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              file_name: newValue
            });
          });
        }
      }
    ))), invalidFileNameWarning !== void 0 && /* @__PURE__ */ import_react170.default.createElement("p", { className: "text-color-error" }, invalidFileNameWarning), /* @__PURE__ */ import_react170.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react170.default.createElement(Col_default, null, /* @__PURE__ */ import_react170.default.createElement("p", { className: "text-header-3" }, "File Type")), /* @__PURE__ */ import_react170.default.createElement(Col_default, null, /* @__PURE__ */ import_react170.default.createElement(
      Select_default,
      {
        width: "medium",
        value: params.type,
        onChange: (newType) => {
          setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              type: newType
            });
          });
        }
      },
      /* @__PURE__ */ import_react170.default.createElement(DropdownItem_default, { title: "CSV", id: "csv", subtext: "Each dataframe will be exported as a seperate CSV file. If multiple dataframes are exported, their names will be appended to the file name." }),
      /* @__PURE__ */ import_react170.default.createElement(DropdownItem_default, { title: "Excel", id: "excel", subtext: "Each exported dataframe will be exported as a seperate sheet." })
    ))), /* @__PURE__ */ import_react170.default.createElement(Row_default, null, /* @__PURE__ */ import_react170.default.createElement(Col_default, null, /* @__PURE__ */ import_react170.default.createElement("p", { className: "text-header-3" }, "Dataframes to Export"))), /* @__PURE__ */ import_react170.default.createElement(
      MultiToggleDataframes_default,
      {
        height: "medium",
        sheetDataArray: props.sheetDataArray,
        selectedSheetIndexes: params.sheet_indexes,
        setUIState: props.setUIState,
        onChange: (newSelectedSheetIndexes) => {
          setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              sheet_indexes: newSelectedSheetIndexes
            });
          });
        }
      }
    )), /* @__PURE__ */ import_react170.default.createElement(DefaultTaskpaneFooter_default, null, editApplied && /* @__PURE__ */ import_react170.default.createElement("p", { className: "text-subtext-1" }, "Files created. Export code generated."), /* @__PURE__ */ import_react170.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          edit();
        },
        disabled: params.file_name === "" || params.sheet_indexes.length === 0 || invalidFileNameWarning !== void 0 || loading
      },
      loading ? "Generating..." : "Generate Export Code"
    )));
  };
  var ExportToFileTaskpane_default = ExportToFileTaskpane;

  // src/components/elements/BottomLeftPopup.tsx
  var import_react192 = __toESM(require_react());

  // src/components/LoadingIndicator.tsx
  var import_react191 = __toESM(require_react());

  // src/components/icons/LoadingCircle.tsx
  var import_react171 = __toESM(require_react());
  var LoadingCircle = () => {
    return /* @__PURE__ */ import_react171.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react171.default.createElement("circle", { cx: "8", cy: "8", r: "7.25", fill: "#F5F5F5", stroke: "#9D6CFF", strokeWidth: "0.5" }), /* @__PURE__ */ import_react171.default.createElement("path", { d: "M15 8C15 7.0256 14.7966 6.06193 14.4027 5.17067C14.0089 4.27941 13.4333 3.48019 12.7128 2.82416L8 8H15Z", fill: "#9D6CFF" }, /* @__PURE__ */ import_react171.default.createElement(
      "animateTransform",
      {
        attributeName: "transform",
        attributeType: "XML",
        type: "rotate",
        from: "0 8 8",
        to: "360 8 8",
        dur: "1s",
        repeatCount: "indefinite"
      }
    )), /* @__PURE__ */ import_react171.default.createElement("circle", { cx: "8", cy: "8", r: "5", fill: "white", stroke: "#9D6CFF", strokeWidth: "0.5" }));
  };
  var LoadingCircle_default = LoadingCircle;

  // src/components/icons/NonLoadingCircle.tsx
  var import_react172 = __toESM(require_react());
  var NonLoadingCircle = () => {
    return /* @__PURE__ */ import_react172.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react172.default.createElement("path", { d: "M8 15.25C12.0041 15.25 15.25 12.0041 15.25 8C15.25 3.99594 12.0041 0.75 8 0.75C3.99593 0.75 0.75 3.99594 0.75 8C0.75 12.0041 3.99593 15.25 8 15.25Z", fill: "#E8EBF8", stroke: "#ACACAD", strokeWidth: "0.5" }));
  };
  var NonLoadingCircle_default = NonLoadingCircle;

  // src/components/taskpanes/Steps/StepDataElement.tsx
  var import_react190 = __toESM(require_react());

  // src/components/icons/ImportIcon.tsx
  var import_react173 = __toESM(require_react());
  var ImportIcon = () => {
    return /* @__PURE__ */ import_react173.default.createElement("svg", { width: "14", height: "15", viewBox: "0 0 14 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react173.default.createElement("path", { d: "M3.58008 6.88696L6.87312 10.1738L10.16 6.88696", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react173.default.createElement("path", { d: "M12.7458 9.68372L12.7334 12.1209C12.7272 13.1628 11.8838 14 10.8482 14H2.88532C1.84345 14 0.993832 13.1566 1.00003 12.1085V9.68372", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react173.default.createElement("path", { d: "M6.87305 0.741211V9.11335", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var ImportIcon_default = ImportIcon;

  // src/components/icons/MergeIcon.tsx
  var import_react174 = __toESM(require_react());
  var MergeIcon = () => {
    return /* @__PURE__ */ import_react174.default.createElement("svg", { width: "19", height: "15", viewBox: "0 0 19 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react174.default.createElement("path", { d: "M7.17099 14.267C10.7582 14.267 13.6662 11.359 13.6662 7.77182C13.6662 4.18462 10.7582 1.27661 7.17099 1.27661C3.58378 1.27661 0.675781 4.18462 0.675781 7.77182C0.675781 11.359 3.58378 14.267 7.17099 14.267Z", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react174.default.createElement("path", { d: "M11.6671 14.267C15.2543 14.267 18.1623 11.359 18.1623 7.77182C18.1623 4.18462 15.2543 1.27661 11.6671 1.27661C8.07988 1.27661 5.17188 4.18462 5.17188 7.77182C5.17188 11.359 8.07988 14.267 11.6671 14.267Z", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var MergeIcon_default = MergeIcon;

  // src/components/icons/PivotIcon.tsx
  var import_react175 = __toESM(require_react());
  var PivotIcon = () => {
    return /* @__PURE__ */ import_react175.default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react175.default.createElement("path", { d: "M14 1.39062H1V14.3906H14V1.39062Z", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react175.default.createElement("path", { d: "M4.56445 1.71179V14.2353", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react175.default.createElement("path", { d: "M1.24023 5.02649H13.7741", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react175.default.createElement("path", { d: "M10.7165 7.89587V10.962H7.75391", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react175.default.createElement("path", { d: "M9.74219 8.81775L10.747 7.80261L11.731 8.77632", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react175.default.createElement("path", { d: "M8.01123 11.9564L6.99609 10.9412L7.9698 9.96753", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var PivotIcon_default = PivotIcon;

  // src/components/icons/DeleteColumnIcon.tsx
  var import_react176 = __toESM(require_react());
  var DeleteColumnIcon = () => {
    return /* @__PURE__ */ import_react176.default.createElement("svg", { width: "14", height: "15", viewBox: "0 0 14 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react176.default.createElement("path", { d: "M9.27408 14.3835H4.67924C3.65951 14.3835 2.82795 13.558 2.83402 12.5322L2.84009 3.94946H11.1618L11.1193 12.5443C11.1193 13.564 10.2938 14.3835 9.27408 14.3835Z", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react176.default.createElement("path", { d: "M1 3.94946H13", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react176.default.createElement("path", { d: "M8.35669 1.4126H5.63742C5.21861 1.4126 4.88477 1.75251 4.88477 2.16525V3.94977H9.11542V2.16525C9.11542 1.75251 8.77551 1.4126 8.35669 1.4126Z", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react176.default.createElement("path", { d: "M5.43164 6.69983V11.3796", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react176.default.createElement("path", { d: "M8.38477 6.69983V11.3796", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var DeleteColumnIcon_default = DeleteColumnIcon;

  // src/components/icons/AddColumnIcon.tsx
  var import_react177 = __toESM(require_react());
  var AddColumnIcon = () => {
    return /* @__PURE__ */ import_react177.default.createElement("svg", { width: "11", height: "15", viewBox: "0 0 11 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react177.default.createElement("path", { d: "M7.44262 12.3725V13.6741C7.44262 14.0686 7.12049 14.3907 6.72604 14.3907H1.71657C1.32213 14.3907 1 14.0686 1 13.6741V2.07742C1 1.68297 1.32213 1.36084 1.71657 1.36084H6.72604C7.12049 1.36084 7.44262 1.68297 7.44262 2.07742V3.24103", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react177.default.createElement("path", { d: "M7.44141 5.41052V10.3411", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react177.default.createElement("path", { d: "M9.91371 7.87573H4.97656", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var AddColumnIcon_default = AddColumnIcon;

  // src/components/icons/EditIcon.tsx
  var import_react178 = __toESM(require_react());
  var EditIcon = (props) => {
    return /* @__PURE__ */ import_react178.default.createElement("svg", { width: props.width || "25", height: props.height || "25", viewBox: "0 0 13 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react178.default.createElement("rect", { x: "8.67323", y: "2.56851", width: "2.27778", height: "9.93478", transform: "rotate(36.5296 8.67323 2.56851)", stroke: "black", strokeWidth: "0.5" }), /* @__PURE__ */ import_react178.default.createElement("rect", { x: "0.349697", y: "-0.0520781", width: "2.27778", height: "2.1087", transform: "matrix(0.80355 0.595237 0.595237 -0.80355 8.33261 2.44081)", stroke: "black", strokeWidth: "0.5" }), /* @__PURE__ */ import_react178.default.createElement("path", { d: "M1.9732 13.5266L4.22513 12.7599L2.05046 11.149L1.9732 13.5266Z", fill: "black" }));
  };
  var EditIcon_default = EditIcon;

  // src/components/icons/MitoIcon.tsx
  var import_react179 = __toESM(require_react());
  var MitoIcon = (props) => {
    return /* @__PURE__ */ import_react179.default.createElement("svg", { width: props.width || "25", height: props.height || "25", viewBox: "0 0 36 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react179.default.createElement("path", { d: "M4.27806 14.4605C4.41192 13.3117 5.01895 12.0216 5.97434 10.7002C7.05826 9.20103 8.57046 7.68957 10.2741 6.33985C11.9773 4.99054 13.8647 3.80854 15.6941 2.96488C17.5272 2.11946 19.2841 1.62217 20.731 1.62217H20.8262L20.8973 1.55886C22.3577 0.258248 24.1677 0.253529 25.9155 1.11776C27.6712 1.98588 29.3356 3.7235 30.4197 5.84055C31.0401 7.05223 31.4658 8.37926 31.6121 9.72767C31.4497 10.4602 31.1397 11.1739 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5047 19.4603 18.5656C18.6629 19.3172 17.9036 20.033 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.78218 22.385 5.10127 18.758 4.27806 14.4605ZM8.07142 22.403C6.88109 21.2513 5.86085 19.9151 5.17471 18.5227C6.56859 21.1106 8.80658 23.0423 11.761 23.4551L11.7783 23.4575H11.7956C14.0044 23.4575 15.7662 22.4397 17.4555 21.0493C18.235 20.4078 19.0063 19.6806 19.8006 18.9319C19.8661 18.8701 19.9318 18.8082 19.9976 18.7462C20.8491 17.9441 21.7325 17.1207 22.6972 16.339C27.0236 15.6292 29.6835 14.0688 31.0672 12.1346C31.3017 11.8069 31.4986 11.4697 31.6603 11.1258C31.6376 11.6681 31.5653 12.2087 31.4378 12.7414C30.8855 15.0491 29.2908 17.2422 26.141 18.8137C25.1942 19.2071 24.2969 19.8633 23.4233 20.6105C22.8835 21.0722 22.3406 21.5797 21.7977 22.0873C21.4643 22.399 21.131 22.7107 20.7983 23.0118C19.0215 24.6198 17.2161 25.9694 15.1112 25.9694C12.9939 25.9694 10.2755 24.5356 8.07142 22.403ZM31.7045 7.69414C31.4887 6.97391 31.204 6.27528 30.8647 5.61267C29.932 3.7912 28.5772 2.22312 27.0733 1.21431C27.108 1.23321 27.1426 1.25235 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C31.4961 6.56563 31.6371 7.12861 31.7045 7.69414ZM10.479 5.54883C12.213 4.17852 14.1208 2.97754 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727788C21.1373 0.67428 21.2705 0.625511 21.4039 0.58136C21.1408 0.730055 20.8844 0.909881 20.6364 1.12282C19.1081 1.14374 17.3123 1.66796 15.4847 2.51083C13.799 3.28822 12.0713 4.34354 10.479 5.54883Z", fill: "#00090F" }), /* @__PURE__ */ import_react179.default.createElement("path", { d: "M4.27806 14.4605C4.41192 13.3117 5.01895 12.0216 5.97434 10.7002C7.05826 9.20103 8.57046 7.68957 10.2741 6.33985C11.9773 4.99054 13.8647 3.80854 15.6941 2.96488C17.5272 2.11946 19.2841 1.62217 20.731 1.62217H20.8262L20.8973 1.55886C22.3577 0.258248 24.1677 0.253529 25.9155 1.11776C27.6712 1.98588 29.3356 3.7235 30.4197 5.84055C31.0401 7.05223 31.4658 8.37926 31.6121 9.72767C31.4497 10.4602 31.1397 11.1739 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5047 19.4603 18.5656C18.6629 19.3172 17.9036 20.033 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.78218 22.385 5.10127 18.758 4.27806 14.4605ZM8.07142 22.403C6.88109 21.2513 5.86085 19.9151 5.17471 18.5227C6.56859 21.1106 8.80658 23.0423 11.761 23.4551L11.7783 23.4575H11.7956C14.0044 23.4575 15.7662 22.4397 17.4555 21.0493C18.235 20.4078 19.0063 19.6806 19.8006 18.9319C19.8661 18.8701 19.9318 18.8082 19.9976 18.7462C20.8491 17.9441 21.7325 17.1207 22.6972 16.339C27.0236 15.6292 29.6835 14.0688 31.0672 12.1346C31.3017 11.8069 31.4986 11.4697 31.6603 11.1258C31.6376 11.6681 31.5653 12.2087 31.4378 12.7414C30.8855 15.0491 29.2908 17.2422 26.141 18.8137C25.1942 19.2071 24.2969 19.8633 23.4233 20.6105C22.8835 21.0722 22.3406 21.5797 21.7977 22.0873C21.4643 22.399 21.131 22.7107 20.7983 23.0118C19.0215 24.6198 17.2161 25.9694 15.1112 25.9694C12.9939 25.9694 10.2755 24.5356 8.07142 22.403ZM31.7045 7.69414C31.4887 6.97391 31.204 6.27528 30.8647 5.61267C29.932 3.7912 28.5772 2.22312 27.0733 1.21431C27.108 1.23321 27.1426 1.25235 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C31.4961 6.56563 31.6371 7.12861 31.7045 7.69414ZM10.479 5.54883C12.213 4.17852 14.1208 2.97754 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727788C21.1373 0.67428 21.2705 0.625511 21.4039 0.58136C21.1408 0.730055 20.8844 0.909881 20.6364 1.12282C19.1081 1.14374 17.3123 1.66796 15.4847 2.51083C13.799 3.28822 12.0713 4.34354 10.479 5.54883Z", fill: "url(#paint0_linear)" }), /* @__PURE__ */ import_react179.default.createElement("path", { d: "M4.27806 14.4605C4.41192 13.3117 5.01895 12.0216 5.97434 10.7002C7.05826 9.20103 8.57046 7.68957 10.2741 6.33985C11.9773 4.99054 13.8647 3.80854 15.6941 2.96488C17.5272 2.11946 19.2841 1.62217 20.731 1.62217H20.8262L20.8973 1.55886C22.3577 0.258248 24.1677 0.253529 25.9155 1.11776C27.6712 1.98588 29.3356 3.7235 30.4197 5.84055C31.0401 7.05223 31.4658 8.37926 31.6121 9.72767C31.4497 10.4602 31.1397 11.1739 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5047 19.4603 18.5656C18.6629 19.3172 17.9036 20.033 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.78218 22.385 5.10127 18.758 4.27806 14.4605ZM8.07142 22.403C6.88109 21.2513 5.86085 19.9151 5.17471 18.5227C6.56859 21.1106 8.80658 23.0423 11.761 23.4551L11.7783 23.4575H11.7956C14.0044 23.4575 15.7662 22.4397 17.4555 21.0493C18.235 20.4078 19.0063 19.6806 19.8006 18.9319C19.8661 18.8701 19.9318 18.8082 19.9976 18.7462C20.8491 17.9441 21.7325 17.1207 22.6972 16.339C27.0236 15.6292 29.6835 14.0688 31.0672 12.1346C31.3017 11.8069 31.4986 11.4697 31.6603 11.1258C31.6376 11.6681 31.5653 12.2087 31.4378 12.7414C30.8855 15.0491 29.2908 17.2422 26.141 18.8137C25.1942 19.2071 24.2969 19.8633 23.4233 20.6105C22.8835 21.0722 22.3406 21.5797 21.7977 22.0873C21.4643 22.399 21.131 22.7107 20.7983 23.0118C19.0215 24.6198 17.2161 25.9694 15.1112 25.9694C12.9939 25.9694 10.2755 24.5356 8.07142 22.403ZM31.7045 7.69414C31.4887 6.97391 31.204 6.27528 30.8647 5.61267C29.932 3.7912 28.5772 2.22312 27.0733 1.21431C27.108 1.23321 27.1426 1.25235 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C31.4961 6.56563 31.6371 7.12861 31.7045 7.69414ZM10.479 5.54883C12.213 4.17852 14.1208 2.97754 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727788C21.1373 0.67428 21.2705 0.625511 21.4039 0.58136C21.1408 0.730055 20.8844 0.909881 20.6364 1.12282C19.1081 1.14374 17.3123 1.66796 15.4847 2.51083C13.799 3.28822 12.0713 4.34354 10.479 5.54883Z", stroke: "black", strokeWidth: "0.5" }), /* @__PURE__ */ import_react179.default.createElement("g", { filter: "url(#filter0_d)" }, /* @__PURE__ */ import_react179.default.createElement("path", { d: "M22.5916 16.1028C18.6195 19.3058 16.0425 23.2075 11.7956 23.2075C7.55216 22.6146 4.79526 18.7684 4 14.3321C4 8.89088 15.1567 0.495911 20.9111 0.495911C29.6603 -3.03026 39.906 13.3076 22.5916 16.1028Z", fill: "#4FBFE8" }), /* @__PURE__ */ import_react179.default.createElement("path", { d: "M22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5046 19.4603 18.5655C18.663 19.3171 17.9036 20.0329 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.73525 22.3784 5.03904 18.6732 4.25006 14.3102C4.25756 13.0333 4.91743 11.5494 6.03489 10.0223C7.15426 8.49265 8.71139 6.94887 10.4529 5.56953C12.1938 4.19062 14.1116 2.98186 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727787C23.1081 -0.119971 25.3091 0.221693 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C32.0133 7.95094 31.9406 10.0545 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856Z", stroke: "#0A0A0A", strokeWidth: "0.5" })), /* @__PURE__ */ import_react179.default.createElement("defs", null, /* @__PURE__ */ import_react179.default.createElement("filter", { id: "filter0_d", x: "0", y: "0", width: "36", height: "31.2075", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ import_react179.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ import_react179.default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ import_react179.default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ import_react179.default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ import_react179.default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ import_react179.default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ import_react179.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ import_react179.default.createElement("linearGradient", { id: "paint0_linear", x1: "24.6767", y1: "23.0067", x2: "-1.7759", y2: "-21.8983", gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ import_react179.default.createElement("stop", { stopColor: "#D17485" }), /* @__PURE__ */ import_react179.default.createElement("stop", { offset: "1", stopColor: "white", stopOpacity: "0" }))));
  };
  var MitoIcon_default = MitoIcon;

  // src/components/icons/DropDuplicatesIcon.tsx
  var import_react180 = __toESM(require_react());
  var DropDuplicatesIcon = () => {
    return /* @__PURE__ */ import_react180.default.createElement("svg", { width: "20", height: "14", viewBox: "0 0 20 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react180.default.createElement("rect", { x: "0.5", y: "0.5", width: "6", height: "13", rx: "0.5", stroke: "#494650" }), /* @__PURE__ */ import_react180.default.createElement("path", { d: "M5 3.5L2 3.49999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react180.default.createElement("path", { d: "M5 7L2 6.99999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react180.default.createElement("path", { d: "M5 10.5L2 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react180.default.createElement("rect", { x: "13.5", y: "0.5", width: "6", height: "13", rx: "0.5", stroke: "#494650" }), /* @__PURE__ */ import_react180.default.createElement("path", { d: "M18 3.5L15 3.49999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react180.default.createElement("path", { d: "M10.3675 5.83334L11 7.00559L10.3934 8.15366", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react180.default.createElement("path", { d: "M10.9103 7.01642H9", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var DropDuplicatesIcon_default = DropDuplicatesIcon;

  // src/components/icons/UnpivotIcon.tsx
  var import_react181 = __toESM(require_react());
  var UnpivotIcon = () => {
    return /* @__PURE__ */ import_react181.default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react181.default.createElement("path", { d: "M3.13939 1.29046V8.80908M1.14394 3.28045H8.66878M4.7103 5.28418H5.6307L6.90303 5.26621V7.04481M5.26378 5.86944L4.65433 5.26621L5.2389 4.67542M7.5 6.89055L6.89055 7.5L6.30598 6.91543M1 1.09766H8.80469V8.90234H1V1.09766Z", stroke: "#494650", strokeWidth: "0.600361", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var UnpivotIcon_default = UnpivotIcon;

  // src/components/icons/DtypeIcon.tsx
  var import_react182 = __toESM(require_react());
  var DtypeIcon = () => {
    return /* @__PURE__ */ import_react182.default.createElement("svg", { width: "33", height: "15", viewBox: "0 0 14 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react182.default.createElement("path", { d: "M2.83203 1.3125V7H2.08984V1.3125H2.83203ZM4.66016 1.3125V1.92969H0.265625V1.3125H4.66016ZM10.3039 7L13.5199 1.424H7.07988L10.3039 7Z", fill: "#494650" }));
  };
  var DtypeIcon_default = DtypeIcon;

  // src/components/icons/SplitTextToColumnsIcon.tsx
  var import_react183 = __toESM(require_react());
  var SplitTextToColumnsIcon = () => {
    return /* @__PURE__ */ import_react183.default.createElement("svg", { width: "12", height: "14", viewBox: "0 0 12 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react183.default.createElement("rect", { x: "0.5", y: "0.5", width: "11", height: "13", rx: "0.5", stroke: "#494650" }), /* @__PURE__ */ import_react183.default.createElement("path", { d: "M5 3.5L2 3.49999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react183.default.createElement("path", { d: "M5 7L2 6.99999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react183.default.createElement("path", { d: "M5 10.5L2 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react183.default.createElement("path", { d: "M5 3.5L2 3.49999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react183.default.createElement("path", { d: "M5 7L2 6.99999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react183.default.createElement("path", { d: "M5 10.5L2 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react183.default.createElement("path", { d: "M10 3.5L7 3.49999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react183.default.createElement("path", { d: "M10 7L7 6.99999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react183.default.createElement("path", { d: "M10 10.5L7 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var SplitTextToColumnsIcon_default = SplitTextToColumnsIcon;

  // src/components/icons/TransposeIcon.tsx
  var import_react184 = __toESM(require_react());
  var TranposeIcon = () => {
    return /* @__PURE__ */ import_react184.default.createElement("svg", { width: "17", height: "16", viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react184.default.createElement("rect", { x: "0.5", y: "15.5", width: "5", height: "9", rx: "0.5", transform: "rotate(-90 0.5 15.5)", stroke: "#494650" }), /* @__PURE__ */ import_react184.default.createElement("path", { d: "M3.44 11.74L3.43999 14.26", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react184.default.createElement("path", { d: "M6.94 11.74L6.93999 14.26", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react184.default.createElement("rect", { x: "16.5", y: "9.5", width: "5", height: "9", rx: "0.5", transform: "rotate(-180 16.5 9.5)", stroke: "#494650" }), /* @__PURE__ */ import_react184.default.createElement("path", { d: "M12.74 6.56L15.26 6.56001", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react184.default.createElement("path", { d: "M12.74 3.06L15.26 3.06001", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react184.default.createElement("path", { d: "M8.02263 3.5L8.02263 3.25L8.02263 3.25L8.02263 3.5ZM9.17677 3.67678C9.27441 3.57914 9.27441 3.42085 9.17678 3.32322L7.58578 1.73223C7.48815 1.6346 7.32986 1.6346 7.23223 1.73223C7.1346 1.82986 7.1346 1.98815 7.23223 2.08579L8.64644 3.5L7.23223 4.91421C7.1346 5.01184 7.1346 5.17013 7.23223 5.26777C7.32986 5.3654 7.48815 5.3654 7.58578 5.26777L9.17677 3.67678ZM8.02263 3.75L9 3.75L9 3.25L8.02263 3.25L8.02263 3.75ZM3.24897 8.97731C2.99378 6.17025 5.20399 3.75 8.02263 3.75L8.02263 3.25C4.90997 3.25 2.46922 5.92271 2.75103 9.02258L3.24897 8.97731Z", fill: "#494650" }));
  };
  var TransposeIcon_default = TranposeIcon;

  // src/components/icons/PromoteRowToHeaderIcon.tsx
  var import_react185 = __toESM(require_react());
  var PromoteRowToHeaderIcon = () => {
    return /* @__PURE__ */ import_react185.default.createElement("svg", { width: "17", height: "14", viewBox: "0 0 17 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react185.default.createElement("rect", { x: "7.5", y: "0.499969", width: "9", height: "13", rx: "0.5", stroke: "#494650" }), /* @__PURE__ */ import_react185.default.createElement("path", { d: "M11.1667 3.49997L8.66667 3.49996", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react185.default.createElement("path", { d: "M11.1667 6.99997L8.66667 6.99996", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react185.default.createElement("path", { d: "M11.1667 10.5L8.66667 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react185.default.createElement("path", { d: "M11.1667 3.49997L8.66667 3.49996", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react185.default.createElement("path", { d: "M11.1667 6.99997L8.66667 6.99996", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react185.default.createElement("path", { d: "M11.1667 10.5L8.66667 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react185.default.createElement("path", { d: "M15.3333 3.49997L12.8333 3.49996", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react185.default.createElement("path", { d: "M15.3333 6.99997L12.8333 6.99996", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react185.default.createElement("path", { d: "M15.3333 10.5L12.8333 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react185.default.createElement("path", { d: "M3.82844 2.24857L5.59653 3.83479L4.01031 5.60288", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react185.default.createElement("path", { d: "M6 10C4 10 6 10 4.09629 9.94194C2.38551 9.70294 1.19356 8.12387 1.43256 6.41309C1.67156 4.70232 3.25063 3.51036 4.96141 3.74936", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var PromoteRowToHeaderIcon_default = PromoteRowToHeaderIcon;

  // src/components/icons/UndoIcon.tsx
  var import_react186 = __toESM(require_react());
  var UndoIcon = () => {
    return /* @__PURE__ */ import_react186.default.createElement("svg", { width: "18", height: "15", viewBox: "0 0 18 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react186.default.createElement("path", { d: "M1.32422 4.71448L4.08798 8.82064L8.19415 6.05688", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react186.default.createElement("path", { d: "M10.6103 13.9999C14.2098 13.9999 17.1249 11.0848 17.1249 7.48529C17.1249 3.88582 14.2098 0.970703 10.6103 0.970703C7.01082 0.970703 4.0957 3.88582 4.0957 7.48529", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var UndoIcon_default = UndoIcon;

  // src/components/icons/RedoIcon.tsx
  var import_react187 = __toESM(require_react());
  var RedoIcon = () => {
    return /* @__PURE__ */ import_react187.default.createElement("svg", { width: "18", height: "15", viewBox: "0 0 18 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react187.default.createElement("path", { d: "M17.1239 4.71448L14.3602 8.82064L10.254 6.05688", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react187.default.createElement("path", { d: "M7.83881 13.9999C4.23933 13.9999 1.32422 11.0848 1.32422 7.48529C1.32422 3.88582 4.23933 0.970703 7.83881 0.970703C11.4383 0.970703 14.3534 3.88582 14.3534 7.48529", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var RedoIcon_default = RedoIcon;

  // src/components/icons/ClearIcon.tsx
  var import_react188 = __toESM(require_react());
  var ClearIcon = () => {
    return /* @__PURE__ */ import_react188.default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react188.default.createElement("path", { d: "M14.0287 10.0429C14.2915 10.1349 14.581 9.99671 14.6538 9.72797C14.9938 8.47296 14.9784 7.14441 14.6041 5.89227C14.1814 4.47868 13.323 3.23478 12.1512 2.33818C10.9795 1.44158 9.55445 0.938138 8.07954 0.89974C6.60464 0.861343 5.15531 1.28996 3.93852 2.12437C2.72173 2.95879 1.7997 4.15634 1.3041 5.54602C0.808504 6.9357 0.764674 8.44644 1.17887 9.86252C1.59307 11.2786 2.44412 12.5276 3.61049 13.4311C4.64364 14.2315 5.87741 14.7246 7.17065 14.8595C7.44758 14.8885 7.68076 14.6682 7.68967 14.3899V14.3899C7.69857 14.1116 7.47971 13.881 7.20315 13.8487C6.12249 13.7227 5.09307 13.3042 4.22798 12.634C3.22961 11.8606 2.50115 10.7916 2.14662 9.57945C1.79208 8.36735 1.8296 7.07422 2.25381 5.88471C2.67802 4.69521 3.46724 3.67015 4.50876 2.95593C5.55028 2.2417 6.79084 1.87483 8.0533 1.90769C9.31576 1.94056 10.5356 2.37149 11.5385 3.13894C12.5415 3.90639 13.2763 4.97112 13.638 6.18109C13.9515 7.22955 13.9709 8.3406 13.6991 9.39409C13.6296 9.66369 13.7659 9.95095 14.0287 10.0429V10.0429Z", fill: "#494650" }), /* @__PURE__ */ import_react188.default.createElement("path", { d: "M11.0684 10.9853C10.8453 11.2084 10.4835 11.2084 10.2603 10.9853L8.23999 8.96498L6.21968 10.9853C5.99653 11.2084 5.63472 11.2084 5.41156 10.9853V10.9853C5.18841 10.7621 5.18841 10.4003 5.41156 10.1772L7.43187 8.15685L5.41156 6.13655C5.18841 5.91339 5.18841 5.55158 5.41156 5.32843V5.32843C5.63472 5.10527 5.99653 5.10527 6.21969 5.32843L8.23999 7.34873L10.2603 5.32843C10.4835 5.10527 10.8453 5.10527 11.0684 5.32843V5.32843C11.2916 5.55158 11.2916 5.91339 11.0684 6.13655L9.04811 8.15685L11.0684 10.1772C11.2916 10.4003 11.2916 10.7621 11.0684 10.9853V10.9853Z", fill: "#494650" }));
  };
  var ClearIcon_default = ClearIcon;

  // src/components/icons/OneHotEncodingIcon.tsx
  var import_react189 = __toESM(require_react());
  var OneHotEncodingIcon = () => {
    return /* @__PURE__ */ import_react189.default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 12 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react189.default.createElement("path", { d: "M3 2.29869V9.50504C3 9.7775 2.9 10 2.77755 10H1.22245C1.1 10 1 9.7775 1 9.50504V1.49495C1 1.2225 1.1 1 1.22245 1H2.77755C2.9 1 3 1.2225 3 1.49495V2.29869Z", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react189.default.createElement("path", { d: "M5.2886 1L6.89001 1C6.95055 1 7 1.1 7 1.22245V2.77755C7 2.9 6.95055 3 6.89001 3H5.10999C5.04944 3 5 2.9 5 2.77755V1.22245C5 1.1 5.04944 1 5.10999 1H5.2886Z", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react189.default.createElement("path", { d: "M5.2886 4.5H6.89001C6.95055 4.5 7 4.6 7 4.72245V6.27755C7 6.4 6.95055 6.5 6.89001 6.5H5.10999C5.04944 6.5 5 6.4 5 6.27755V4.72245C5 4.6 5.04944 4.5 5.10999 4.5H5.2886Z", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react189.default.createElement("path", { d: "M5.2886 8H6.89001C6.95055 8 7 8.1 7 8.22245V9.77755C7 9.9 6.95055 10 6.89001 10H5.10999C5.04944 10 5 9.9 5 9.77755V8.22245C5 8.1 5.04944 8 5.10999 8H5.2886Z", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react189.default.createElement("path", { d: "M9.2886 1L10.89 1C10.9506 1 11 1.1 11 1.22245V2.77755C11 2.9 10.9506 3 10.89 3H9.10999C9.04944 3 9 2.9 9 2.77755V1.22245C9 1.1 9.04944 1 9.10999 1H9.2886Z", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react189.default.createElement("path", { d: "M9.2886 4.5H10.89C10.9506 4.5 11 4.6 11 4.72245V6.27755C11 6.4 10.9506 6.5 10.89 6.5H9.10999C9.04944 6.5 9 6.4 9 6.27755V4.72245C9 4.6 9.04944 4.5 9.10999 4.5H9.2886Z", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react189.default.createElement("path", { d: "M9.2886 8H10.89C10.9506 8 11 8.1 11 8.22245V9.77755C11 9.9 10.9506 10 10.89 10H9.10999C9.04944 10 9 9.9 9 9.77755V8.22245C9 8.1 9.04944 8 9.10999 8H9.2886Z", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var OneHotEncodingIcon_default = OneHotEncodingIcon;

  // src/components/taskpanes/Steps/StepDataElement.tsx
  function getIcon(stepType, height, width) {
    switch (stepType) {
      case "initialize" /* Initialize */:
        return /* @__PURE__ */ import_react190.default.createElement(MitoIcon_default, null);
      case "add_column" /* AddColumn */:
        return /* @__PURE__ */ import_react190.default.createElement(AddColumnIcon_default, null);
      case "delete_column" /* DeleteColumn */:
        return /* @__PURE__ */ import_react190.default.createElement(DeleteColumnIcon_default, null);
      case "rename_column" /* RenameColumn */:
        return /* @__PURE__ */ import_react190.default.createElement(EditIcon_default, { height, width });
      case "reorder_column" /* ReorderColumn */:
        return /* @__PURE__ */ import_react190.default.createElement(EditIcon_default, { height, width });
      case "filter_column" /* FilterColumn */:
        return /* @__PURE__ */ import_react190.default.createElement(FilterIcon, { purpleOrDark: "dark" });
      case "set_column_formula" /* SetColumnFormula */:
        return /* @__PURE__ */ import_react190.default.createElement("div", { className: "step-taskpane-missing-icon" }, "Fx");
      case "dataframe_delete" /* DataframeDelete */:
        return /* @__PURE__ */ import_react190.default.createElement(DeleteColumnIcon_default, null);
      case "dataframe_duplicate" /* DataframeDuplicate */:
        return /* @__PURE__ */ import_react190.default.createElement(EditIcon_default, { height, width });
      case "dataframe_rename" /* DataframeRename */:
        return /* @__PURE__ */ import_react190.default.createElement(EditIcon_default, { height, width });
      case "simple_import" /* SimpleImport */:
        return /* @__PURE__ */ import_react190.default.createElement(ImportIcon_default, null);
      case "dataframe_import" /* DataframeImport */:
        return /* @__PURE__ */ import_react190.default.createElement(ImportIcon_default, null);
      case "excel_import" /* ExcelImport */:
        return /* @__PURE__ */ import_react190.default.createElement(ImportIcon_default, null);
      case "sort" /* Sort */:
        return /* @__PURE__ */ import_react190.default.createElement(EditIcon_default, { height, width });
      case "pivot" /* Pivot */:
        return /* @__PURE__ */ import_react190.default.createElement(PivotIcon_default, null);
      case "melt" /* Melt */:
        return /* @__PURE__ */ import_react190.default.createElement(UnpivotIcon_default, null);
      case "merge" /* Merge */:
        return /* @__PURE__ */ import_react190.default.createElement(MergeIcon_default, null);
      case "drop_duplicates" /* DropDuplicates */:
        return /* @__PURE__ */ import_react190.default.createElement(DropDuplicatesIcon_default, null);
      case "graph" /* Graph */:
        return /* @__PURE__ */ import_react190.default.createElement(GraphIcon_default, null);
      case "change_column_dtype" /* ChangeColumnDtype */:
        return /* @__PURE__ */ import_react190.default.createElement(DtypeIcon_default, null);
      case "delete_row" /* DeleteRow */:
        return /* @__PURE__ */ import_react190.default.createElement(DeleteColumnIcon_default, null);
      case "split_text_to_columns" /* SplitTextToColumns */:
        return /* @__PURE__ */ import_react190.default.createElement(SplitTextToColumnsIcon_default, null);
      case "transpose" /* Transpose */:
        return /* @__PURE__ */ import_react190.default.createElement(TransposeIcon_default, null);
      case "promote_row_to_header" /* PromoteRowToHeader */:
        return /* @__PURE__ */ import_react190.default.createElement(PromoteRowToHeaderIcon_default, null);
      case "one_hot_encoding" /* OneHotEncoding */:
        return /* @__PURE__ */ import_react190.default.createElement(OneHotEncodingIcon_default, null);
      case "undo" /* Undo */:
        return /* @__PURE__ */ import_react190.default.createElement(UndoIcon_default, null);
      case "redo" /* Redo */:
        return /* @__PURE__ */ import_react190.default.createElement(RedoIcon_default, null);
      case "clear" /* Clear */:
        return /* @__PURE__ */ import_react190.default.createElement(ClearIcon_default, null);
      default:
        return /* @__PURE__ */ import_react190.default.createElement(EditIcon_default, { height, width });
    }
  }
  function StepDataElement(props) {
    const toggleStepRollBack = () => {
      if (props.isCurrIdx) {
        void props.mitoAPI.updateCheckoutStepByIndex(props.lastIndex);
      } else {
        void props.mitoAPI.updateCheckoutStepByIndex(props.stepData.step_idx);
      }
    };
    {
    }
    return /* @__PURE__ */ import_react190.default.createElement(
      "div",
      {
        className: "step-taskpane-step-container",
        style: { opacity: props.beforeCurrIdx ? "1" : ".5" },
        onClick: toggleStepRollBack
      },
      /* @__PURE__ */ import_react190.default.createElement("div", { className: "step-taskpane-step-icon" }, getIcon(props.stepData.step_type)),
      /* @__PURE__ */ import_react190.default.createElement("div", { className: "element-width-block hide-scrollbar" }, /* @__PURE__ */ import_react190.default.createElement("div", { className: "text-header-3" }, props.stepData.step_display_name), /* @__PURE__ */ import_react190.default.createElement("div", { className: "text-body-2 text-overflow-scroll hide-scrollbar" }, props.stepData.step_description))
    );
  }
  var StepDataElement_default = StepDataElement;

  // src/components/LoadingIndicator.tsx
  var isEditEvent = (messageType) => {
    return messageType.endsWith("_edit");
  };
  var isUpdateEvent = (messageType) => {
    return Object.values(UpdateType).includes(messageType);
  };
  var getDisplayMessageForMessageType = (messageType) => {
    switch (messageType) {
      case "initialize" /* Initialize */: {
        return "Created a Mitosheet";
      }
      case "add_column" /* AddColumn */: {
        return "Adding a column";
      }
      case "delete_column" /* DeleteColumn */: {
        return "Deleting a column";
      }
      case "rename_column" /* RenameColumn */: {
        return "Renaming a column";
      }
      case "reorder_column" /* ReorderColumn */: {
        return "Reording a column";
      }
      case "fill_na" /* FillNa */: {
        return "Filling NaN values";
      }
      case "filter_column" /* FilterColumn */: {
        return "Filtering a column";
      }
      case "set_column_formula" /* SetColumnFormula */: {
        return "Setting a formula";
      }
      case "dataframe_delete" /* DataframeDelete */: {
        return "Deleting a dataframe";
      }
      case "dataframe_duplicate" /* DataframeDuplicate */: {
        return "Duplicating a dataframe";
      }
      case "dataframe_rename" /* DataframeRename */: {
        return "Renaming a dataframe";
      }
      case "simple_import" /* SimpleImport */: {
        return "Importing a CSV";
      }
      case "sort" /* Sort */: {
        return "Sorting a dataframe";
      }
      case "pivot" /* Pivot */: {
        return "Pivoting a dataframe";
      }
      case "merge" /* Merge */: {
        return "Merging dataframes";
      }
      case "concat" /* Concat */: {
        return "Concatenating dataframes";
      }
      case "drop_duplicates" /* DropDuplicates */: {
        return "Dropping duplicates";
      }
      case "change_column_dtype" /* ChangeColumnDtype */: {
        return "Changing a dtype";
      }
      case "set_cell_value" /* SetCellValue */: {
        return "Setting a cell value";
      }
      case "bulk_old_rename" /* BulkOldRename */: {
        return "Bulk old rename";
      }
      case "excel_import" /* ExcelImport */: {
        return "Importing Excel file";
      }
      case "graph" /* Graph */: {
        return "Creating graph";
      }
      case "graph_duplicate" /* GraphDuplicate */: {
        return "Duplicating graph";
      }
      case "graph_delete" /* GraphDelete */: {
        return "Deleting graph";
      }
      case "graph_rename" /* GraphRename */: {
        return "Renaming graph";
      }
      case "delete_row" /* DeleteRow */: {
        return "Deleting row";
      }
      case "promote_row_to_header" /* PromoteRowToHeader */: {
        return "Promoting row to header";
      }
      case "split_text_to_columns" /* SplitTextToColumns */: {
        return "Spliting column";
      }
      case "transpose" /* Transpose */: {
        return "Transposing dataframe";
      }
      case "melt" /* Melt */: {
        return "Melting dataframe";
      }
      case "set_dataframe_format" /* SetDataframeFormat */: {
        return "Changing formatting";
      }
      case "one_hot_encoding" /* OneHotEncoding */: {
        return "One hot encoding";
      }
      case "dataframe_import" /* DataframeImport */: {
        return "Dataframe Import";
      }
      case "snowflake_import" /* SnowflakeImport */: {
        return "Snowflake Import";
      }
      case "excel_range_import" /* ExcelRangeImport */: {
        return "Excel Range Import";
      }
      case "export_to_file" /* ExportToFile */: {
        return "Generating Export Code";
      }
      case "reset_index" /* ResetIndex */: {
        return "Resetting Index";
      }
      case "undo" /* Undo */: {
        return "Undoing previous edit";
      }
      case "redo" /* Redo */: {
        return "Redoing previous edit";
      }
      case "clear" /* Clear */: {
        return "Clearing all edits";
      }
      case "args_update" /* ArgsUpdate */: {
        return "Updating user profile";
      }
      case "save_analysis_update" /* SaveAnalysisUpdate */: {
        return "Saving analysis";
      }
      case "replay_analysis_update" /* ReplayAnalysisUpdate */: {
        return "Replaying analysis";
      }
      case "checkout_step_by_idx_update" /* CheckoutStepByIdxUpdate */: {
        return "Checking out step";
      }
      case "append_user_field_update" /* AppendUserFieldUpdate */: {
        return "Updating user profile";
      }
      case "set_user_field_update" /* SetUserFieldUpdate */: {
        return "Updating user profile";
      }
      case "update_feedback_v2_obj_update" /* UpdateFeedbackv2ObjObject */: {
        return "Updating user profile";
      }
      case "go_pro" /* GoPro */: {
        return "Activating Mito Pro";
      }
      case "render_count_update" /* RenderCountUpdate */: {
        return "Updating user profile";
      }
      case "checklist_update" /* ChecklistUpdate */: {
        return "Updating checklist";
      }
      case "update_existing_import_update" /* UpdateExistingImportUpdate */: {
        return "Changing imports";
      }
    }
  };
  var getMessageType = (messageType) => {
    if (isEditEvent(messageType)) {
      return messageType.substring(0, messageType.length - "_edit".length);
    } else if (isUpdateEvent(messageType)) {
      return messageType;
    }
    return void 0;
  };
  var getMessageTypesToDisplay = (loading) => {
    const seenStepIds = [];
    return loading.filter(([, step_id]) => {
      if (step_id !== void 0) {
        if (seenStepIds.includes(step_id)) {
          return false;
        }
        seenStepIds.push(step_id);
      }
      return true;
    }).map(([message_id, , type]) => {
      return [getMessageType(type), message_id];
    }).filter(([messageType]) => {
      return messageType !== void 0;
    });
  };
  var getSlowLoadingMessage = (currentLoadingMessage, message_id) => {
    const is10SecondsAgo = currentLoadingMessage && message_id === currentLoadingMessage[1] && currentLoadingMessage[0] <= Date.now() - 10 * 1e3;
    const is20SecondsAgo = currentLoadingMessage && message_id === currentLoadingMessage[1] && currentLoadingMessage[0] <= Date.now() - 20 * 1e3;
    const is30SecondsAgo = currentLoadingMessage && message_id === currentLoadingMessage[1] && currentLoadingMessage[0] <= Date.now() - 30 * 1e3;
    const is40SecondsAgo = currentLoadingMessage && message_id === currentLoadingMessage[1] && currentLoadingMessage[0] <= Date.now() - 40 * 1e3;
    const is50SecondsAgo = currentLoadingMessage && message_id === currentLoadingMessage[1] && currentLoadingMessage[0] <= Date.now() - 40 * 1e3;
    const is60SecondsAgo = currentLoadingMessage && message_id === currentLoadingMessage[1] && currentLoadingMessage[0] <= Date.now() - 60 * 1e3;
    if (is60SecondsAgo) {
      return "Still executing pandas code";
    } else if (is50SecondsAgo) {
      return "Doing the dataframe dance";
    } else if (is40SecondsAgo) {
      return "Working hard behind the scenes";
    } else if (is30SecondsAgo) {
      return "Still executing pandas code";
    } else if (is20SecondsAgo) {
      return "Doing the dataframe dance";
    } else if (is10SecondsAgo) {
      return "Still executing pandas code";
    }
    return void 0;
  };
  var LoadingIndicator = (props) => {
    const [currentLoadingMessage, setCurrentLoadingMessage] = (0, import_react191.useState)(void 0);
    (0, import_react191.useEffect)(() => {
      const interval = setInterval(() => {
        const messagesToDisplay2 = getMessageTypesToDisplay(props.loading);
        if (messagesToDisplay2.length === 0) {
          setCurrentLoadingMessage(void 0);
        } else {
          setCurrentLoadingMessage((prevLoadingMessage) => {
            const topMessageID = messagesToDisplay2[0][1];
            if (prevLoadingMessage === void 0 || topMessageID !== prevLoadingMessage[1]) {
              return [Date.now(), topMessageID];
            }
            return prevLoadingMessage;
          });
        }
        setCurrentLoadingMessage((prevCurrentLoadingMessage) => {
          if (prevCurrentLoadingMessage === void 0)
            return prevCurrentLoadingMessage;
          return [prevCurrentLoadingMessage[0], prevCurrentLoadingMessage[1]];
        });
      }, 1e3);
      return () => {
        clearInterval(interval);
      };
    }, [props.loading]);
    const messagesToDisplay = getMessageTypesToDisplay(props.loading);
    if (messagesToDisplay.length === 0) {
      return /* @__PURE__ */ import_react191.default.createElement(import_react191.default.Fragment, null);
    }
    return /* @__PURE__ */ import_react191.default.createElement(import_react191.default.Fragment, null, /* @__PURE__ */ import_react191.default.createElement("p", { className: "loading-indicator-header text-header-3 text-color-white-important" }, "Processing ", messagesToDisplay.length, " edit", messagesToDisplay.length <= 1 ? "" : "s"), /* @__PURE__ */ import_react191.default.createElement("div", { className: "loading-indicator-content" }, messagesToDisplay.map(([messageType, message_id], index) => {
      const slowLoadingMessage = getSlowLoadingMessage(currentLoadingMessage, message_id);
      return messageType !== void 0 && /* @__PURE__ */ import_react191.default.createElement("div", { key: index, className: classNames("mb-5px", "mt-5px", { "text-color-medium-gray-important": index !== 0 }) }, /* @__PURE__ */ import_react191.default.createElement(
        "div",
        {
          key: index,
          className: classNames("loading-indicator-item")
        },
        /* @__PURE__ */ import_react191.default.createElement("div", { className: "loading-indicator-icon", style: { opacity: index !== 0 ? "50%" : void 0 } }, getIcon(messageType, "15", "15")),
        /* @__PURE__ */ import_react191.default.createElement("div", { className: "ml-5px" }, /* @__PURE__ */ import_react191.default.createElement("div", { className: "text-body-1" }, getDisplayMessageForMessageType(messageType)), slowLoadingMessage !== void 0 && /* @__PURE__ */ import_react191.default.createElement("div", { className: "text-subtext-1" }, slowLoadingMessage)),
        /* @__PURE__ */ import_react191.default.createElement("div", { className: "loading-indicator-loader" }, index === 0 && /* @__PURE__ */ import_react191.default.createElement(LoadingCircle_default, null), index !== 0 && /* @__PURE__ */ import_react191.default.createElement(NonLoadingCircle_default, null))
      ));
    })));
  };
  var LoadingIndicator_default = LoadingIndicator;

  // src/components/elements/BottomLeftPopup.tsx
  var BottomLeftPopup = (props) => {
    const [displayLoadingIndicator, setDisplayLoadingIndicator] = (0, import_react192.useState)(false);
    (0, import_react192.useEffect)(() => {
      if (props.loading.length === 0) {
        setDisplayLoadingIndicator(false);
      } else if (props.loading.length > 0) {
        const timeout = setTimeout(() => {
          setDisplayLoadingIndicator(true);
        }, 500);
        return () => {
          clearTimeout(timeout);
        };
      }
    }, [props.loading.length]);
    return /* @__PURE__ */ import_react192.default.createElement(import_react192.default.Fragment, null, displayLoadingIndicator && /* @__PURE__ */ import_react192.default.createElement("div", { className: "bottom-left-popup-container" }, /* @__PURE__ */ import_react192.default.createElement(LoadingIndicator_default, { loading: props.loading })));
  };
  var BottomLeftPopup_default = BottomLeftPopup;

  // src/components/popups/EphemeralMessage.tsx
  var import_react194 = __toESM(require_react());

  // src/components/elements/DefaultPopup.tsx
  var import_react193 = __toESM(require_react());
  var DefaultPopup = (props) => {
    let popupLocationClass = void 0;
    switch (props.popupLocation) {
      case "top_right" /* TopRight */:
        popupLocationClass = "top-right-popup-container";
    }
    return /* @__PURE__ */ import_react193.default.createElement("div", { className: classNames("popup-container", popupLocationClass, props.className) }, props.children);
  };
  var DefaultPopup_default = DefaultPopup;

  // src/components/popups/EphemeralMessage.tsx
  var EphemeralMessage = (props) => {
    const closePopup = () => {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenPopups: __spreadProps(__spreadValues({}, prevUIState.currOpenPopups), {
            [props.popupLocation]: { type: "none" /* None */ }
          })
        });
      });
    };
    (0, import_react194.useEffect)(() => {
      const interval = setInterval(() => {
        closePopup();
      }, 6e3);
      return () => {
        clearInterval(interval);
      };
    }, [props.message]);
    return /* @__PURE__ */ import_react194.default.createElement(DefaultPopup_default, { popupLocation: props.popupLocation, className: "ephemeral-message-animation" }, /* @__PURE__ */ import_react194.default.createElement(Row_default, { className: classNames("ephemeral-message-container"), align: "center", suppressTopBottomMargin: true }, /* @__PURE__ */ import_react194.default.createElement("p", { className: classNames("text-body-1", "text-color-white-important", "mr-10px") }, props.message), /* @__PURE__ */ import_react194.default.createElement(
      "div",
      {
        className: "mt-5px ml-5px",
        onClick: () => closePopup()
      },
      /* @__PURE__ */ import_react194.default.createElement(XIcon_default, { variant: "light" })
    )));
  };
  var EphemeralMessage_default = EphemeralMessage;

  // src/components/taskpanes/Steps/StepsTaskpane.tsx
  var import_react195 = __toESM(require_react());
  function StepTaskpane(props) {
    return /* @__PURE__ */ import_react195.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react195.default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Step History",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ import_react195.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react195.default.createElement("div", { className: "step-takspane-container" }, props.stepSummaryList.map((stepSummary) => {
      return /* @__PURE__ */ import_react195.default.createElement(
        StepDataElement_default,
        {
          key: stepSummary.step_id,
          beforeCurrIdx: stepSummary.step_idx <= props.currStepIdx,
          isCurrIdx: stepSummary.step_idx === props.currStepIdx,
          lastIndex: props.stepSummaryList[props.stepSummaryList.length - 1].step_idx,
          stepData: stepSummary,
          mitoAPI: props.mitoAPI
        }
      );
    }))));
  }
  var StepsTaskpane_default = StepTaskpane;

  // src/components/taskpanes/UpgradeToPro/UpgradeToProTaskpane.tsx
  var import_react198 = __toESM(require_react());

  // src/hooks/useInputValue.tsx
  var import_react196 = __toESM(require_react());
  var useInputValue = (value = "", placeholder = "") => {
    const [_value, _setValue] = (0, import_react196.useState)(value);
    const onChange = (e) => {
      const newValue = e.target.value;
      _setValue(newValue);
    };
    return {
      "value": _value,
      "placeholder": placeholder,
      "onChange": onChange
    };
  };

  // src/components/icons/PurpleCheckMark.tsx
  var import_react197 = __toESM(require_react());
  var PurpleCheckMark = () => {
    return /* @__PURE__ */ import_react197.default.createElement("svg", { width: "18", height: "15", viewBox: "0 0 18 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react197.default.createElement("path", { d: "M2 8.88525L6.15622 12.4914C6.57338 12.8534 7.20496 12.8086 7.5669 12.3914L16.3562 2.26144", stroke: "#9D6CFF", strokeWidth: "4" }));
  };
  var PurpleCheckMark_default = PurpleCheckMark;

  // src/components/taskpanes/UpgradeToPro/UpgradeToProTaskpane.tsx
  var ProListElement = (props) => {
    return /* @__PURE__ */ import_react198.default.createElement(Row_default, null, /* @__PURE__ */ import_react198.default.createElement(Col_default, { span: 2 }, /* @__PURE__ */ import_react198.default.createElement(PurpleCheckMark_default, null)), /* @__PURE__ */ import_react198.default.createElement("p", { className: "text-body-1" }, props.text));
  };
  var UpgradeToProTaskpane = (props) => {
    const [isEnteringAccessCode, setIsEnteringAccessCode] = (0, import_react198.useState)(false);
    const accessCodeInput = useInputValue("", "mito-pro-access-code-ASKDJQWDKQWDLL");
    const [invalidAccessCode, setInvalidAccessCode] = (0, import_react198.useState)(false);
    const isPro = props.userProfile.isPro;
    (0, import_react198.useEffect)(() => {
      void props.mitoAPI.log("opened_upgrade_to_pro_taskpane");
    }, []);
    if (!isPro && !isEnteringAccessCode) {
      return /* @__PURE__ */ import_react198.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react198.default.createElement(
        DefaultTaskpaneHeader_default,
        {
          header: "Upgrade to Mito Pro",
          setUIState: props.setUIState
        }
      ), /* @__PURE__ */ import_react198.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react198.default.createElement("p", { className: "text-body-1 mb-10px" }, /* @__PURE__ */ import_react198.default.createElement("a", { href: "https://trymito.io/plans", target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ import_react198.default.createElement("span", { className: "text-body-1-link" }, "Mito Pro")), " gives you extra features to super charge your analysis:"), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "Turn off all telemetry" }), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "Generated code optimization" }), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "Import from external drives" }), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "Format datframes" }), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "Style graphs" }), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "Priority support" }), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "All future pro functionality!" }), /* @__PURE__ */ import_react198.default.createElement("div", { className: "mt-25px" }, /* @__PURE__ */ import_react198.default.createElement(Row_default, { justify: "space-around" }, /* @__PURE__ */ import_react198.default.createElement("form", { className: "element-width-block", action: "https://jl76z192i0.execute-api.us-east-1.amazonaws.com/Prod/create_checkout_session/", method: "POST", target: "_blank" }, /* @__PURE__ */ import_react198.default.createElement(
        "button",
        {
          className: classNames("text-button", "text-header-3", "text-overflow-wrap", "element-width-block", "text-button-variant-dark"),
          type: "submit",
          onClick: () => {
            void props.mitoAPI.log("clicked_purchase_mito_pro");
            setTimeout(() => setIsEnteringAccessCode(true), 100);
          }
        },
        "Purchase Mito Pro"
      ))), /* @__PURE__ */ import_react198.default.createElement(Row_default, { justify: "space-around", className: "mb-5px mt-5px" }, /* @__PURE__ */ import_react198.default.createElement("p", { className: "text-body-1" }, "Or")), /* @__PURE__ */ import_react198.default.createElement(Row_default, { justify: "space-around" }, /* @__PURE__ */ import_react198.default.createElement(TextButton_default, { variant: "dark", onClick: () => {
        setIsEnteringAccessCode(true);
      } }, "Enter Access Code")))));
    } else if (!isPro && isEnteringAccessCode) {
      return /* @__PURE__ */ import_react198.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react198.default.createElement(
        DefaultTaskpaneHeader_default,
        {
          header: "Enter Access Code",
          setUIState: props.setUIState
        }
      ), /* @__PURE__ */ import_react198.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react198.default.createElement(Row_default, { align: "center" }, /* @__PURE__ */ import_react198.default.createElement(Col_default, { span: 5 }, /* @__PURE__ */ import_react198.default.createElement("p", { className: "text-heading-2" }, "Access Code:")), /* @__PURE__ */ import_react198.default.createElement(Col_default, { span: 2 }, /* @__PURE__ */ import_react198.default.createElement(Tooltip_default, { title: "Get an access code by purchasing a Pro license on the previous page." }))), /* @__PURE__ */ import_react198.default.createElement(Input_default, __spreadValues({}, accessCodeInput)), invalidAccessCode && /* @__PURE__ */ import_react198.default.createElement("div", { className: "text-color-error" }, "Sorry, that access code is invalid. Purchase Mito Pro from the previous page and then enter the access code here."), /* @__PURE__ */ import_react198.default.createElement(Spacer_default, { px: 20 }), /* @__PURE__ */ import_react198.default.createElement(Row_default, { justify: "space-around" }, /* @__PURE__ */ import_react198.default.createElement(Col_default, null, /* @__PURE__ */ import_react198.default.createElement(TextButton_default, { variant: "light", onClick: () => {
        setIsEnteringAccessCode(false);
      } }, "Back")), /* @__PURE__ */ import_react198.default.createElement(Col_default, null, /* @__PURE__ */ import_react198.default.createElement(
        TextButton_default,
        {
          variant: "dark",
          onClick: async () => {
            if (!checkProAccessCode(accessCodeInput.value)) {
              setInvalidAccessCode(true);
              return;
            }
            setInvalidAccessCode(false);
            await props.mitoAPI.log("signup_completed_pro", { "location": "upgrade_to_pro_taskpane" });
            await props.mitoAPI.updateGoPro();
            setIsEnteringAccessCode(false);
          }
        },
        "Submit Access Code"
      )))));
    } else {
      return /* @__PURE__ */ import_react198.default.createElement(DefaultTaskpane_default, null, /* @__PURE__ */ import_react198.default.createElement(
        DefaultTaskpaneHeader_default,
        {
          header: "Welcome to Mito Pro!",
          setUIState: props.setUIState
        }
      ), /* @__PURE__ */ import_react198.default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ import_react198.default.createElement("p", { className: "text-heading-4 mb-10px" }, "You've successfully upgraded to Mito Pro. You can cancel any time by sending us an email."), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "All telemetry is off" }), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "Generated code is being optimized" }), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "Style graphs" }), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "Format dataframes" }), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "Export formatting" }), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "Get priority support" }), /* @__PURE__ */ import_react198.default.createElement(ProListElement, { text: "All future pro functionality!" })));
    }
  };
  var UpgradeToProTaskpane_default = UpgradeToProTaskpane;

  // src/components/toolbar/Toolbar.tsx
  var import_react218 = __toESM(require_react());

  // src/components/toolbar/PlanButton.tsx
  var import_react199 = __toESM(require_react());
  var PlanButton = (props) => {
    const disabledDueToReplayAnalysis = props.uiState.currOpenTaskpane.type === "UpdateImports" /* UPDATEIMPORTS */ && props.uiState.currOpenTaskpane.failedReplayData !== void 0;
    return /* @__PURE__ */ import_react199.default.createElement(
      "div",
      {
        className: classNames("text-button", "text-button-variant-dark", "plan-button", "cursor-pointer"),
        onClick: () => {
          if (disabledDueToReplayAnalysis) {
            return;
          }
          if (!props.userProfile.isPro) {
            void props.mitoAPI.log("clicked_plan_button");
          }
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "upgrade_to_pro" /* UPGRADE_TO_PRO */ },
              selectedTabType: "data"
            });
          });
        }
      },
      props.userProfile.isPro ? "Mito Pro" : "Upgrade to Mito Pro"
    );
  };
  var PlanButton_default = PlanButton;

  // src/components/toolbar/ToolbarButton.tsx
  var import_react207 = __toESM(require_react());

  // src/components/toolbar/utils.tsx
  var import_react206 = __toESM(require_react());

  // src/components/icons/ExportIcon.tsx
  var import_react200 = __toESM(require_react());
  var ExportIcon = () => {
    return /* @__PURE__ */ import_react200.default.createElement("svg", { width: "13", height: "14", viewBox: "0 0 13 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react200.default.createElement("path", { d: "M9.58016 3.81644L6.50004 0.734863L3.41992 3.81644", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react200.default.createElement("path", { d: "M12 9.10571L11.9883 11.3851C11.9839 12.3571 11.1934 13.1447 10.2213 13.1447H2.76697C1.79052 13.1432 1 12.3513 1 11.3748L1.00146 9.10571", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react200.default.createElement("path", { d: "M6.5 9.56679V1.73181", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var ExportIcon_default = ExportIcon;

  // src/components/icons/FullscreenIcons.tsx
  var import_react201 = __toESM(require_react());
  var OpenFullscreenIcon = () => {
    return /* @__PURE__ */ import_react201.default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react201.default.createElement("path", { d: "M6.05571 9.08911L1 14.1448", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react201.default.createElement("path", { d: "M14.001 1.14478L8.94531 6.20048", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react201.default.createElement("path", { d: "M1 9.08911V14.1448H6.05571", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react201.default.createElement("path", { d: "M14.001 6.20048V1.14478H8.94531", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var CloseFullscreenIcon = () => {
    return /* @__PURE__ */ import_react201.default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react201.default.createElement("path", { d: "M6.05555 8.94434L1 13.9999", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react201.default.createElement("path", { d: "M8.94445 6.05566L14 1.00011", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react201.default.createElement("path", { d: "M6.05469 13.9998V8.9442H0.999135", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react201.default.createElement("path", { d: "M8.94445 1.00011V6.05566H14", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };

  // src/components/icons/StepsIcon.tsx
  var import_react202 = __toESM(require_react());
  var StepsIcon = () => {
    return /* @__PURE__ */ import_react202.default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react202.default.createElement("path", { d: "M12.6916 13.5156H2.30835C1.58458 13.5156 1 12.9881 1 12.335V12.0963C1 11.4432 1.58458 10.9156 2.30835 10.9156H12.6916C13.4154 10.9156 14 11.4432 14 12.0963V12.335C14 12.9881 13.4154 13.5156 12.6916 13.5156Z", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react202.default.createElement("path", { d: "M12.6916 8.31558H2.30835C1.58458 8.31558 1 7.79058 1 7.14058V6.89058C1 6.24058 1.58458 5.71558 2.30835 5.71558H12.6916C13.4154 5.71558 14 6.24058 14 6.89058V7.12808C14 7.79058 13.4154 8.31558 12.6916 8.31558Z", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ import_react202.default.createElement("path", { d: "M12.6916 3.11563H2.30835C1.58458 3.11563 1 2.58809 1 1.93495V1.6963C1 1.04316 1.58458 0.515625 2.30835 0.515625H12.6916C13.4154 0.515625 14 1.04316 14 1.6963V1.93495C14 2.58809 13.4154 3.11563 12.6916 3.11563Z", stroke: "#343434", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var StepsIcon_default = StepsIcon;

  // src/components/icons/FormatIcon.tsx
  var import_react203 = __toESM(require_react());
  var FormatIcon = () => {
    return /* @__PURE__ */ import_react203.default.createElement("svg", { width: "33", height: "15", viewBox: "0 0 33 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react203.default.createElement("path", { d: "M3.73236 9.3125H2.64252V2.08789L0.45697 2.89062V1.90625L3.56244 0.740234H3.73236V9.3125ZM12.498 9.3125H6.90814V8.5332L9.86127 5.25195C10.2988 4.75586 10.5995 4.35352 10.7636 4.04492C10.9316 3.73242 11.0156 3.41016 11.0156 3.07812C11.0156 2.63281 10.8808 2.26758 10.6113 1.98242C10.3417 1.69727 9.98236 1.55469 9.53314 1.55469C8.99408 1.55469 8.57416 1.70898 8.27338 2.01758C7.9765 2.32227 7.82806 2.74805 7.82806 3.29492H6.74408C6.74408 2.50977 6.99603 1.875 7.49994 1.39062C8.00775 0.90625 8.68549 0.664062 9.53314 0.664062C10.3261 0.664062 10.9531 0.873047 11.414 1.29102C11.8749 1.70508 12.1054 2.25781 12.1054 2.94922C12.1054 3.78906 11.5703 4.78906 10.4999 5.94922L8.21478 8.42773H12.498V9.3125ZM15.2226 4.51953H16.037C16.5488 4.51172 16.9511 4.37695 17.2441 4.11523C17.537 3.85352 17.6835 3.5 17.6835 3.05469C17.6835 2.05469 17.1855 1.55469 16.1894 1.55469C15.7206 1.55469 15.3456 1.68945 15.0644 1.95898C14.787 2.22461 14.6484 2.57813 14.6484 3.01953H13.5644C13.5644 2.34375 13.8105 1.7832 14.3027 1.33789C14.7988 0.888672 15.4277 0.664062 16.1894 0.664062C16.9941 0.664062 17.6249 0.876953 18.082 1.30273C18.539 1.72852 18.7675 2.32031 18.7675 3.07812C18.7675 3.44922 18.6464 3.80859 18.4042 4.15625C18.166 4.50391 17.8398 4.76367 17.4257 4.93555C17.8945 5.08398 18.2558 5.33008 18.5097 5.67383C18.7675 6.01758 18.8964 6.4375 18.8964 6.93359C18.8964 7.69922 18.6464 8.30664 18.1464 8.75586C17.6464 9.20508 16.996 9.42969 16.1953 9.42969C15.3945 9.42969 14.7421 9.21289 14.2382 8.7793C13.7382 8.3457 13.4882 7.77344 13.4882 7.0625H14.5781C14.5781 7.51172 14.7245 7.87109 15.0175 8.14062C15.3105 8.41016 15.7031 8.54492 16.1953 8.54492C16.7187 8.54492 17.1191 8.4082 17.3964 8.13477C17.6738 7.86133 17.8124 7.46875 17.8124 6.95703C17.8124 6.46094 17.6601 6.08008 17.3554 5.81445C17.0507 5.54883 16.6113 5.41211 16.037 5.4043H15.2226V4.51953ZM28.1003 9.3125L23.2643 0.9485H32.9243L28.1003 9.3125Z", fill: "#494650" }));
  };
  var FormatIcon_default = FormatIcon;

  // src/components/icons/MoreIcon.tsx
  var import_react204 = __toESM(require_react());
  var MoreIcon = () => {
    return /* @__PURE__ */ import_react204.default.createElement("svg", { width: "22", height: "15", viewBox: "0 0 13 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react204.default.createElement("path", { d: "M1.50781 6.61719C1.50781 6.49479 1.54557 6.39193 1.62109 6.30859C1.69922 6.22266 1.8112 6.17969 1.95703 6.17969C2.10286 6.17969 2.21354 6.22266 2.28906 6.30859C2.36719 6.39193 2.40625 6.49479 2.40625 6.61719C2.40625 6.73698 2.36719 6.83854 2.28906 6.92188C2.21354 7.00521 2.10286 7.04688 1.95703 7.04688C1.8112 7.04688 1.69922 7.00521 1.62109 6.92188C1.54557 6.83854 1.50781 6.73698 1.50781 6.61719ZM7.09766 3.70312V4.57031C7.09766 5.03646 7.05599 5.42969 6.97266 5.75C6.88932 6.07031 6.76953 6.32812 6.61328 6.52344C6.45703 6.71875 6.26823 6.86068 6.04688 6.94922C5.82812 7.03516 5.58073 7.07812 5.30469 7.07812C5.08594 7.07812 4.88411 7.05078 4.69922 6.99609C4.51432 6.94141 4.34766 6.85417 4.19922 6.73438C4.05339 6.61198 3.92839 6.45312 3.82422 6.25781C3.72005 6.0625 3.64062 5.82552 3.58594 5.54688C3.53125 5.26823 3.50391 4.94271 3.50391 4.57031V3.70312C3.50391 3.23698 3.54557 2.84635 3.62891 2.53125C3.71484 2.21615 3.83594 1.96354 3.99219 1.77344C4.14844 1.58073 4.33594 1.44271 4.55469 1.35938C4.77604 1.27604 5.02344 1.23438 5.29688 1.23438C5.51823 1.23438 5.72135 1.26172 5.90625 1.31641C6.09375 1.36849 6.26042 1.45312 6.40625 1.57031C6.55208 1.6849 6.67578 1.83854 6.77734 2.03125C6.88151 2.22135 6.96094 2.45443 7.01562 2.73047C7.07031 3.00651 7.09766 3.33073 7.09766 3.70312ZM6.37109 4.6875V3.58203C6.37109 3.32682 6.35547 3.10286 6.32422 2.91016C6.29557 2.71484 6.2526 2.54818 6.19531 2.41016C6.13802 2.27214 6.0651 2.16016 5.97656 2.07422C5.89062 1.98828 5.79036 1.92578 5.67578 1.88672C5.5638 1.84505 5.4375 1.82422 5.29688 1.82422C5.125 1.82422 4.97266 1.85677 4.83984 1.92188C4.70703 1.98438 4.59505 2.08464 4.50391 2.22266C4.41536 2.36068 4.34766 2.54167 4.30078 2.76562C4.25391 2.98958 4.23047 3.26172 4.23047 3.58203V4.6875C4.23047 4.94271 4.24479 5.16797 4.27344 5.36328C4.30469 5.55859 4.35026 5.72786 4.41016 5.87109C4.47005 6.01172 4.54297 6.1276 4.62891 6.21875C4.71484 6.3099 4.8138 6.3776 4.92578 6.42188C5.04036 6.46354 5.16667 6.48438 5.30469 6.48438C5.48177 6.48438 5.63672 6.45052 5.76953 6.38281C5.90234 6.3151 6.01302 6.20964 6.10156 6.06641C6.19271 5.92057 6.26042 5.73438 6.30469 5.50781C6.34896 5.27865 6.37109 5.00521 6.37109 4.6875ZM11.5977 3.70312V4.57031C11.5977 5.03646 11.556 5.42969 11.4727 5.75C11.3893 6.07031 11.2695 6.32812 11.1133 6.52344C10.957 6.71875 10.7682 6.86068 10.5469 6.94922C10.3281 7.03516 10.0807 7.07812 9.80469 7.07812C9.58594 7.07812 9.38411 7.05078 9.19922 6.99609C9.01432 6.94141 8.84766 6.85417 8.69922 6.73438C8.55339 6.61198 8.42839 6.45312 8.32422 6.25781C8.22005 6.0625 8.14062 5.82552 8.08594 5.54688C8.03125 5.26823 8.00391 4.94271 8.00391 4.57031V3.70312C8.00391 3.23698 8.04557 2.84635 8.12891 2.53125C8.21484 2.21615 8.33594 1.96354 8.49219 1.77344C8.64844 1.58073 8.83594 1.44271 9.05469 1.35938C9.27604 1.27604 9.52344 1.23438 9.79688 1.23438C10.0182 1.23438 10.2214 1.26172 10.4062 1.31641C10.5938 1.36849 10.7604 1.45312 10.9062 1.57031C11.0521 1.6849 11.1758 1.83854 11.2773 2.03125C11.3815 2.22135 11.4609 2.45443 11.5156 2.73047C11.5703 3.00651 11.5977 3.33073 11.5977 3.70312ZM10.8711 4.6875V3.58203C10.8711 3.32682 10.8555 3.10286 10.8242 2.91016C10.7956 2.71484 10.7526 2.54818 10.6953 2.41016C10.638 2.27214 10.5651 2.16016 10.4766 2.07422C10.3906 1.98828 10.2904 1.92578 10.1758 1.88672C10.0638 1.84505 9.9375 1.82422 9.79688 1.82422C9.625 1.82422 9.47266 1.85677 9.33984 1.92188C9.20703 1.98438 9.09505 2.08464 9.00391 2.22266C8.91536 2.36068 8.84766 2.54167 8.80078 2.76562C8.75391 2.98958 8.73047 3.26172 8.73047 3.58203V4.6875C8.73047 4.94271 8.74479 5.16797 8.77344 5.36328C8.80469 5.55859 8.85026 5.72786 8.91016 5.87109C8.97005 6.01172 9.04297 6.1276 9.12891 6.21875C9.21484 6.3099 9.3138 6.3776 9.42578 6.42188C9.54036 6.46354 9.66667 6.48438 9.80469 6.48438C9.98177 6.48438 10.1367 6.45052 10.2695 6.38281C10.4023 6.3151 10.513 6.20964 10.6016 6.06641C10.6927 5.92057 10.7604 5.73438 10.8047 5.50781C10.849 5.27865 10.8711 5.00521 10.8711 4.6875Z", fill: "#494650" }));
  };
  var MoreIcon_default = MoreIcon;

  // src/components/icons/LessIcon.tsx
  var import_react205 = __toESM(require_react());
  var LessIcon = () => {
    return /* @__PURE__ */ import_react205.default.createElement("svg", { width: "22", height: "15", viewBox: "0 0 7 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react205.default.createElement("path", { d: "M0.757812 6.61719C0.757812 6.49479 0.795573 6.39193 0.871094 6.30859C0.949219 6.22266 1.0612 6.17969 1.20703 6.17969C1.35286 6.17969 1.46354 6.22266 1.53906 6.30859C1.61719 6.39193 1.65625 6.49479 1.65625 6.61719C1.65625 6.73698 1.61719 6.83854 1.53906 6.92188C1.46354 7.00521 1.35286 7.04688 1.20703 7.04688C1.0612 7.04688 0.949219 7.00521 0.871094 6.92188C0.795573 6.83854 0.757812 6.73698 0.757812 6.61719ZM6.34766 3.70312V4.57031C6.34766 5.03646 6.30599 5.42969 6.22266 5.75C6.13932 6.07031 6.01953 6.32812 5.86328 6.52344C5.70703 6.71875 5.51823 6.86068 5.29688 6.94922C5.07812 7.03516 4.83073 7.07812 4.55469 7.07812C4.33594 7.07812 4.13411 7.05078 3.94922 6.99609C3.76432 6.94141 3.59766 6.85417 3.44922 6.73438C3.30339 6.61198 3.17839 6.45312 3.07422 6.25781C2.97005 6.0625 2.89062 5.82552 2.83594 5.54688C2.78125 5.26823 2.75391 4.94271 2.75391 4.57031V3.70312C2.75391 3.23698 2.79557 2.84635 2.87891 2.53125C2.96484 2.21615 3.08594 1.96354 3.24219 1.77344C3.39844 1.58073 3.58594 1.44271 3.80469 1.35938C4.02604 1.27604 4.27344 1.23438 4.54688 1.23438C4.76823 1.23438 4.97135 1.26172 5.15625 1.31641C5.34375 1.36849 5.51042 1.45312 5.65625 1.57031C5.80208 1.6849 5.92578 1.83854 6.02734 2.03125C6.13151 2.22135 6.21094 2.45443 6.26562 2.73047C6.32031 3.00651 6.34766 3.33073 6.34766 3.70312ZM5.62109 4.6875V3.58203C5.62109 3.32682 5.60547 3.10286 5.57422 2.91016C5.54557 2.71484 5.5026 2.54818 5.44531 2.41016C5.38802 2.27214 5.3151 2.16016 5.22656 2.07422C5.14062 1.98828 5.04036 1.92578 4.92578 1.88672C4.8138 1.84505 4.6875 1.82422 4.54688 1.82422C4.375 1.82422 4.22266 1.85677 4.08984 1.92188C3.95703 1.98438 3.84505 2.08464 3.75391 2.22266C3.66536 2.36068 3.59766 2.54167 3.55078 2.76562C3.50391 2.98958 3.48047 3.26172 3.48047 3.58203V4.6875C3.48047 4.94271 3.49479 5.16797 3.52344 5.36328C3.55469 5.55859 3.60026 5.72786 3.66016 5.87109C3.72005 6.01172 3.79297 6.1276 3.87891 6.21875C3.96484 6.3099 4.0638 6.3776 4.17578 6.42188C4.29036 6.46354 4.41667 6.48438 4.55469 6.48438C4.73177 6.48438 4.88672 6.45052 5.01953 6.38281C5.15234 6.3151 5.26302 6.20964 5.35156 6.06641C5.44271 5.92057 5.51042 5.73438 5.55469 5.50781C5.59896 5.27865 5.62109 5.00521 5.62109 4.6875Z", fill: "#494650" }));
  };
  var LessIcon_default = LessIcon;

  // src/components/toolbar/utils.tsx
  var getToolbarItemIcon = (toolbarButtonType) => {
    switch (toolbarButtonType) {
      case "UNDO" /* UNDO */: {
        return /* @__PURE__ */ import_react206.default.createElement(UndoIcon_default, null);
      }
      case "REDO" /* REDO */: {
        return /* @__PURE__ */ import_react206.default.createElement(RedoIcon_default, null);
      }
      case "CLEAR" /* CLEAR */: {
        return /* @__PURE__ */ import_react206.default.createElement(ClearIcon_default, null);
      }
      case "IMPORT" /* IMPORT */: {
        return /* @__PURE__ */ import_react206.default.createElement(ImportIcon_default, null);
      }
      case "EXPORT" /* EXPORT */: {
        return /* @__PURE__ */ import_react206.default.createElement(ExportIcon_default, null);
      }
      case "ADD COL" /* ADD_COL */: {
        return /* @__PURE__ */ import_react206.default.createElement(AddColumnIcon_default, null);
      }
      case "DEL COL" /* DEL_COL */: {
        return /* @__PURE__ */ import_react206.default.createElement(DeleteColumnIcon_default, null);
      }
      case "DTYPE" /* DTYPE */: {
        return /* @__PURE__ */ import_react206.default.createElement(DtypeIcon_default, null);
      }
      case "LESS" /* LESS */: {
        return /* @__PURE__ */ import_react206.default.createElement(LessIcon_default, null);
      }
      case "MORE" /* MORE */: {
        return /* @__PURE__ */ import_react206.default.createElement(MoreIcon_default, null);
      }
      case "FORMAT" /* FORMAT */: {
        return /* @__PURE__ */ import_react206.default.createElement(FormatIcon_default, null);
      }
      case "PIVOT" /* PIVOT */: {
        return /* @__PURE__ */ import_react206.default.createElement(PivotIcon_default, null);
      }
      case "GRAPH" /* GRAPH */: {
        return /* @__PURE__ */ import_react206.default.createElement(GraphIcon_default, null);
      }
      case "CATCH UP" /* CATCH_UP */: {
        return /* @__PURE__ */ import_react206.default.createElement(CatchUpIcon_default, null);
      }
      case "STEPS" /* STEPS */: {
        return /* @__PURE__ */ import_react206.default.createElement(StepsIcon_default, null);
      }
      case "OPEN FULLSCREEN" /* OPEN_FULLSCREEN */: {
        return /* @__PURE__ */ import_react206.default.createElement(OpenFullscreenIcon, null);
      }
      case "CLOSE FULLSCREEN" /* CLOSE_FULLSCREEN */: {
        return /* @__PURE__ */ import_react206.default.createElement(CloseFullscreenIcon, null);
      }
    }
  };
  var makeToolbarDropdownItem = (action, userProfile2, supressFocusSettingOnClose) => {
    return /* @__PURE__ */ import_react206.default.createElement(
      DropdownItem_default,
      {
        key: action.longTitle,
        title: action.longTitle,
        onClick: action.actionFunction,
        disabled: action.isDisabled() !== void 0,
        tooltip: action.isDisabled(),
        rightText: getToolbarDropdownItemRightText(action, userProfile2),
        supressFocusSettingOnClose
      }
    );
  };
  var getToolbarDropdownItemRightText = (action, userProfile2) => {
    var _a, _b;
    if (action.proAction && !userProfile2.isPro) {
      return "Mito Pro";
    }
    return window.navigator.userAgent.toUpperCase().includes("MAC") ? (_a = action.displayKeyboardShortcuts) == null ? void 0 : _a.mac : (_b = action.displayKeyboardShortcuts) == null ? void 0 : _b.windows;
  };

  // src/components/toolbar/ToolbarButton.tsx
  var ToolbarButton = (props) => {
    const disabled = props.disabledTooltip !== void 0;
    const highlightToobarItemClass = props.highlightToolbarButton === true ? "toolbar-button-draw-attention" : "";
    return /* @__PURE__ */ import_react207.default.createElement(
      "div",
      {
        className: classNames("toolbar-button-container", disabled ? "toolbar-button-container-disabled" : "toolbar-button-container-enabled"),
        id: props.id,
        onClick: () => {
          if (disabled) {
            return;
          }
          if (props.setEditorState) {
            props.setEditorState(void 0);
          }
          props.action.actionFunction();
        }
      },
      /* @__PURE__ */ import_react207.default.createElement(
        "button",
        {
          className: classNames("toolbar-button", "vertical-align-content", highlightToobarItemClass),
          type: "button"
        },
        /* @__PURE__ */ import_react207.default.createElement("span", { title: props.disabledTooltip || props.action.tooltip }, /* @__PURE__ */ import_react207.default.createElement("div", { className: "toolbar-button-icon-container" }, getToolbarItemIcon(props.toolbarButtonType)), /* @__PURE__ */ import_react207.default.createElement("p", { className: "toolbar-button-label" }, props.action.shortTitle))
      ),
      props.children !== void 0 && props.children
    );
  };
  var ToolbarButton_default = ToolbarButton;

  // src/components/toolbar/ToolbarColumnsDropdown.tsx
  var import_react208 = __toESM(require_react());
  var ToolbarColumnsDropdown = (props) => {
    return /* @__PURE__ */ import_react208.default.createElement(import_react208.default.Fragment, null, /* @__PURE__ */ import_react208.default.createElement(
      Dropdown_default,
      {
        display: props.uiState.currOpenToolbarDropdown === "Columns",
        closeDropdown: () => props.setUIState((prevUIState) => {
          if (prevUIState.currOpenToolbarDropdown === "Columns") {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenToolbarDropdown: void 0
            });
          } else {
            return prevUIState;
          }
        }),
        width: "large"
      },
      makeToolbarDropdownItem(props.actions["add column" /* Add_Column */], props.userProfile),
      makeToolbarDropdownItem(props.actions["rename column" /* Rename_Column */], props.userProfile, true),
      makeToolbarDropdownItem(props.actions["delete column" /* Delete_Column */], props.userProfile),
      /* @__PURE__ */ import_react208.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      makeToolbarDropdownItem(props.actions["set column formula" /* Set_Column_Formula */], props.userProfile, true),
      makeToolbarDropdownItem(props.actions["set cell value" /* Set_Cell_Value */], props.userProfile, true),
      makeToolbarDropdownItem(props.actions["split text to column" /* Split_Text_To_Column */], props.userProfile),
      props.userProfile.isPro ? makeToolbarDropdownItem(props.actions["one_hot_encoding" /* One_Hot_Encoding */], props.userProfile) : /* @__PURE__ */ import_react208.default.createElement(import_react208.default.Fragment, null),
      makeToolbarDropdownItem(props.actions["format number columns" /* Format_Number_Columns */], props.userProfile),
      /* @__PURE__ */ import_react208.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      makeToolbarDropdownItem(props.actions["filter" /* Filter */], props.userProfile),
      makeToolbarDropdownItem(props.actions["sort" /* Sort */], props.userProfile),
      makeToolbarDropdownItem(props.actions["change dtype" /* Change_Dtype */], props.userProfile),
      makeToolbarDropdownItem(props.actions["fill na" /* Fill_Na */], props.userProfile),
      /* @__PURE__ */ import_react208.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      makeToolbarDropdownItem(props.actions["unique values" /* Unique_Values */], props.userProfile),
      makeToolbarDropdownItem(props.actions["column summary" /* Column_Summary */], props.userProfile)
    ));
  };
  var ToolbarColumnsDropdown_default = ToolbarColumnsDropdown;

  // src/components/toolbar/ToolbarDataframesDropdown.tsx
  var import_react209 = __toESM(require_react());
  var ToolbarDataframesDropdown = (props) => {
    return /* @__PURE__ */ import_react209.default.createElement(import_react209.default.Fragment, null, /* @__PURE__ */ import_react209.default.createElement(
      Dropdown_default,
      {
        display: props.uiState.currOpenToolbarDropdown === "Dataframes",
        closeDropdown: () => props.setUIState((prevUIState) => {
          if (prevUIState.currOpenToolbarDropdown === "Dataframes") {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenToolbarDropdown: void 0
            });
          }
          return prevUIState;
        }),
        width: "large"
      },
      makeToolbarDropdownItem(props.actions["import files" /* Import_Files */], props.userProfile),
      makeToolbarDropdownItem(props.actions["Dataframe_Import" /* Dataframe_Import */], props.userProfile),
      makeToolbarDropdownItem(props.actions["SnowflakeImport" /* SNOWFLAKEIMPORT */], props.userProfile),
      makeToolbarDropdownItem(props.actions["updateImports" /* UPDATEIMPORTS */], props.userProfile),
      /* @__PURE__ */ import_react209.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      makeToolbarDropdownItem(props.actions["export" /* Export */], props.userProfile),
      /* @__PURE__ */ import_react209.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      makeToolbarDropdownItem(props.actions["pivot" /* Pivot */], props.userProfile),
      makeToolbarDropdownItem(props.actions["melt" /* Melt */], props.userProfile),
      makeToolbarDropdownItem(props.actions["drop duplicates" /* Drop_Duplicates */], props.userProfile),
      makeToolbarDropdownItem(props.actions["merge" /* Merge */], props.userProfile),
      makeToolbarDropdownItem(props.actions["concat_dataframes" /* Concat_Dataframes */], props.userProfile),
      makeToolbarDropdownItem(props.actions["transpose" /* Transpose */], props.userProfile),
      /* @__PURE__ */ import_react209.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      makeToolbarDropdownItem(props.actions["duplicate dataframe" /* Duplicate_Dataframe */], props.userProfile),
      makeToolbarDropdownItem(props.actions["rename dataframe" /* Rename_Dataframe */], props.userProfile, true),
      makeToolbarDropdownItem(props.actions["delete dataframe" /* Delete_Dataframe */], props.userProfile)
    ));
  };
  var ToolbarDataframesDropdown_default = ToolbarDataframesDropdown;

  // src/components/toolbar/ToolbarDropdownSelector.tsx
  var import_react210 = __toESM(require_react());
  var ToolbarDropdownSelector = (props) => {
    const selected = props.uiState.currOpenToolbarDropdown === props.type;
    return /* @__PURE__ */ import_react210.default.createElement("div", null, /* @__PURE__ */ import_react210.default.createElement(
      "p",
      {
        className: classNames("toolbar-dropdown-selector", "text-unselectable", { "toolbar-dropdown-selector-selected": selected }),
        onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), { currOpenToolbarDropdown: props.type });
          });
        },
        onMouseEnter: () => {
          props.setUIState((prevUIState) => {
            if (prevUIState.currOpenToolbarDropdown !== void 0 && !selected) {
              return __spreadProps(__spreadValues({}, prevUIState), { currOpenToolbarDropdown: props.type });
            }
            return prevUIState;
          });
        }
      },
      props.type
    ), props.children);
  };
  var ToolbarDropdownSelector_default = ToolbarDropdownSelector;

  // src/components/toolbar/ToolbarEditDropdown.tsx
  var import_react211 = __toESM(require_react());
  var ToolbarEditDropdown = (props) => {
    return /* @__PURE__ */ import_react211.default.createElement(import_react211.default.Fragment, null, /* @__PURE__ */ import_react211.default.createElement(
      Dropdown_default,
      {
        display: props.uiState.currOpenToolbarDropdown === "Edit",
        closeDropdown: () => props.setUIState((prevUIState) => {
          if (prevUIState.currOpenToolbarDropdown === "Edit") {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenToolbarDropdown: void 0
            });
          }
          return prevUIState;
        }),
        width: "medium"
      },
      makeToolbarDropdownItem(props.actions["undo" /* Undo */], props.userProfile),
      makeToolbarDropdownItem(props.actions["redo" /* Redo */], props.userProfile),
      makeToolbarDropdownItem(props.actions["clear" /* Clear */], props.userProfile),
      /* @__PURE__ */ import_react211.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      makeToolbarDropdownItem(props.actions["copy" /* Copy */], props.userProfile)
    ));
  };
  var ToolbarEditDropdown_default = ToolbarEditDropdown;

  // src/components/toolbar/ToolbarFormatDropdown.tsx
  var import_react212 = __toESM(require_react());
  var ToolbarFormatDropdown = (props) => {
    return /* @__PURE__ */ import_react212.default.createElement(import_react212.default.Fragment, null, /* @__PURE__ */ import_react212.default.createElement(
      Dropdown_default,
      {
        display: props.uiState.currOpenToolbarDropdown === "Format",
        closeDropdown: () => props.setUIState((prevUIState) => {
          if (prevUIState.currOpenToolbarDropdown === "Format") {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenToolbarDropdown: void 0
            });
          }
          return prevUIState;
        }),
        width: "large"
      },
      makeToolbarDropdownItem(props.actions["set_dataframe_format" /* Set_Dataframe_Format */], props.userProfile),
      makeToolbarDropdownItem(props.actions["ConditionalFormatting" /* Conditional_Formatting */], props.userProfile),
      /* @__PURE__ */ import_react212.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      makeToolbarDropdownItem(props.actions["format number columns" /* Format_Number_Columns */], props.userProfile),
      makeToolbarDropdownItem(props.actions["precision decrease" /* Precision_Decrease */], props.userProfile),
      makeToolbarDropdownItem(props.actions["precision increase" /* Precision_Increase */], props.userProfile)
    ));
  };
  var ToolbarFormatDropdown_default = ToolbarFormatDropdown;

  // src/components/toolbar/ToolbarGraphsDropdown.tsx
  var import_react213 = __toESM(require_react());
  var ToolbarGraphsDropdown = (props) => {
    return /* @__PURE__ */ import_react213.default.createElement(import_react213.default.Fragment, null, /* @__PURE__ */ import_react213.default.createElement(
      Dropdown_default,
      {
        display: props.uiState.currOpenToolbarDropdown === "Graphs",
        closeDropdown: () => props.setUIState((prevUIState) => {
          if (prevUIState.currOpenToolbarDropdown === "Graphs") {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenToolbarDropdown: void 0
            });
          }
          return prevUIState;
        }),
        width: "medium"
      },
      makeToolbarDropdownItem(props.actions["graph" /* Graph */], props.userProfile),
      /* @__PURE__ */ import_react213.default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      makeToolbarDropdownItem(props.actions["duplicate graph" /* Duplicate_Graph */], props.userProfile),
      makeToolbarDropdownItem(props.actions["rename graph" /* Rename_Graph */], props.userProfile),
      makeToolbarDropdownItem(props.actions["delete graph" /* Delete_Graph */], props.userProfile)
    ));
  };
  var ToolbarGraphsDropdown_default = ToolbarGraphsDropdown;

  // src/components/toolbar/ToolbarHelpDropdown.tsx
  var import_react214 = __toESM(require_react());
  var ToolbarHelpDropdown = (props) => {
    const allActions = getSortedActions(props.actions);
    return /* @__PURE__ */ import_react214.default.createElement(import_react214.default.Fragment, null, /* @__PURE__ */ import_react214.default.createElement(
      Dropdown_default,
      {
        display: props.uiState.currOpenToolbarDropdown === "Help",
        searchable: true,
        closeDropdown: () => props.setUIState((prevUIState) => {
          if (prevUIState.currOpenToolbarDropdown === "Help") {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenToolbarDropdown: void 0
            });
          }
          return prevUIState;
        }),
        width: "large"
      },
      allActions.map((action) => {
        return makeToolbarDropdownItem(action, props.userProfile);
      })
    ));
  };
  var ToolbarHelpDropdown_default = ToolbarHelpDropdown;

  // src/components/toolbar/ToolbarRowsDropdown.tsx.tsx
  var import_react215 = __toESM(require_react());
  var ToolbarRowsDropdown = (props) => {
    return /* @__PURE__ */ import_react215.default.createElement(import_react215.default.Fragment, null, /* @__PURE__ */ import_react215.default.createElement(
      Dropdown_default,
      {
        display: props.uiState.currOpenToolbarDropdown === "Rows",
        closeDropdown: () => props.setUIState((prevUIState) => {
          if (prevUIState.currOpenToolbarDropdown === "Rows") {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenToolbarDropdown: void 0
            });
          }
          return prevUIState;
        }),
        width: "large"
      },
      makeToolbarDropdownItem(props.actions["delete row" /* Delete_Row */], props.userProfile),
      makeToolbarDropdownItem(props.actions["promote row to header" /* Promote_Row_To_Header */], props.userProfile)
    ));
  };
  var ToolbarRowsDropdown_tsx_default = ToolbarRowsDropdown;

  // src/components/toolbar/ToolbarViewDropdown.tsx
  var import_react216 = __toESM(require_react());
  var ToolbarViewDropdown = (props) => {
    return /* @__PURE__ */ import_react216.default.createElement(import_react216.default.Fragment, null, /* @__PURE__ */ import_react216.default.createElement(
      Dropdown_default,
      {
        display: props.uiState.currOpenToolbarDropdown === "View",
        closeDropdown: () => props.setUIState((prevUIState) => {
          if (prevUIState.currOpenToolbarDropdown === "View") {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenToolbarDropdown: void 0
            });
          }
          return prevUIState;
        }),
        width: "medium"
      },
      makeToolbarDropdownItem(props.actions["fullscreen" /* Fullscreen */], props.userProfile)
    ));
  };
  var ToolbarViewDropdown_default = ToolbarViewDropdown;

  // src/components/toolbar/ToolbarCodeDropdown.tsx
  var import_react217 = __toESM(require_react());
  var ToolbarCodeDropdown = (props) => {
    return /* @__PURE__ */ import_react217.default.createElement(import_react217.default.Fragment, null, /* @__PURE__ */ import_react217.default.createElement(
      Dropdown_default,
      {
        display: props.uiState.currOpenToolbarDropdown === "Code",
        closeDropdown: () => props.setUIState((prevUIState) => {
          if (prevUIState.currOpenToolbarDropdown === "Code") {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenToolbarDropdown: void 0
            });
          }
          return prevUIState;
        }),
        width: "medium"
      },
      makeToolbarDropdownItem(props.actions["CodeSnippets" /* CODESNIPPETS */], props.userProfile)
    ));
  };
  var ToolbarCodeDropdown_default = ToolbarCodeDropdown;

  // src/components/toolbar/Toolbar.tsx
  var Toolbar = (props) => {
    return /* @__PURE__ */ import_react218.default.createElement("div", { className: "toolbar-container" }, /* @__PURE__ */ import_react218.default.createElement("div", { className: "toolbar-top" }, /* @__PURE__ */ import_react218.default.createElement("div", { className: "toolbar-top-left" }, /* @__PURE__ */ import_react218.default.createElement(ToolbarDropdownSelector_default, { type: "Edit", uiState: props.uiState, setUIState: props.setUIState }, /* @__PURE__ */ import_react218.default.createElement(
      ToolbarEditDropdown_default,
      {
        actions: props.actions,
        uiState: props.uiState,
        setUIState: props.setUIState,
        userProfile: props.userProfile
      }
    )), /* @__PURE__ */ import_react218.default.createElement(ToolbarDropdownSelector_default, { type: "Dataframes", uiState: props.uiState, setUIState: props.setUIState }, /* @__PURE__ */ import_react218.default.createElement(
      ToolbarDataframesDropdown_default,
      {
        actions: props.actions,
        uiState: props.uiState,
        setUIState: props.setUIState,
        userProfile: props.userProfile
      }
    )), /* @__PURE__ */ import_react218.default.createElement(ToolbarDropdownSelector_default, { type: "Columns", uiState: props.uiState, setUIState: props.setUIState }, /* @__PURE__ */ import_react218.default.createElement(
      ToolbarColumnsDropdown_default,
      {
        actions: props.actions,
        uiState: props.uiState,
        setUIState: props.setUIState,
        userProfile: props.userProfile
      }
    )), /* @__PURE__ */ import_react218.default.createElement(ToolbarDropdownSelector_default, { type: "Rows", uiState: props.uiState, setUIState: props.setUIState }, /* @__PURE__ */ import_react218.default.createElement(
      ToolbarRowsDropdown_tsx_default,
      {
        actions: props.actions,
        uiState: props.uiState,
        setUIState: props.setUIState,
        userProfile: props.userProfile
      }
    )), /* @__PURE__ */ import_react218.default.createElement(ToolbarDropdownSelector_default, { type: "Graphs", uiState: props.uiState, setUIState: props.setUIState }, /* @__PURE__ */ import_react218.default.createElement(
      ToolbarGraphsDropdown_default,
      {
        actions: props.actions,
        uiState: props.uiState,
        setUIState: props.setUIState,
        userProfile: props.userProfile
      }
    )), /* @__PURE__ */ import_react218.default.createElement(ToolbarDropdownSelector_default, { type: "Format", uiState: props.uiState, setUIState: props.setUIState }, /* @__PURE__ */ import_react218.default.createElement(
      ToolbarFormatDropdown_default,
      {
        actions: props.actions,
        uiState: props.uiState,
        setUIState: props.setUIState,
        userProfile: props.userProfile
      }
    )), /* @__PURE__ */ import_react218.default.createElement(ToolbarDropdownSelector_default, { type: "Code", uiState: props.uiState, setUIState: props.setUIState }, /* @__PURE__ */ import_react218.default.createElement(
      ToolbarCodeDropdown_default,
      {
        actions: props.actions,
        uiState: props.uiState,
        setUIState: props.setUIState,
        userProfile: props.userProfile
      }
    )), /* @__PURE__ */ import_react218.default.createElement(ToolbarDropdownSelector_default, { type: "View", uiState: props.uiState, setUIState: props.setUIState }, /* @__PURE__ */ import_react218.default.createElement(
      ToolbarViewDropdown_default,
      {
        actions: props.actions,
        uiState: props.uiState,
        setUIState: props.setUIState,
        userProfile: props.userProfile
      }
    )), /* @__PURE__ */ import_react218.default.createElement(ToolbarDropdownSelector_default, { type: "Help", uiState: props.uiState, setUIState: props.setUIState }, /* @__PURE__ */ import_react218.default.createElement(
      ToolbarHelpDropdown_default,
      {
        actions: props.actions,
        uiState: props.uiState,
        setUIState: props.setUIState,
        userProfile: props.userProfile
      }
    ))), /* @__PURE__ */ import_react218.default.createElement("div", { className: "toolbar-top-right" }, /* @__PURE__ */ import_react218.default.createElement(
      GetSupportButton_default,
      {
        userProfile: props.userProfile,
        setUIState: props.setUIState,
        mitoAPI: props.mitoAPI,
        width: "small",
        className: "plan-button"
      }
    ), /* @__PURE__ */ import_react218.default.createElement(
      PlanButton_default,
      {
        uiState: props.uiState,
        userProfile: props.userProfile,
        setUIState: props.setUIState,
        mitoAPI: props.mitoAPI
      }
    ))), /* @__PURE__ */ import_react218.default.createElement("div", { className: "toolbar-top-bottom-seperator" }), /* @__PURE__ */ import_react218.default.createElement("div", { className: "toolbar-bottom" }, /* @__PURE__ */ import_react218.default.createElement("div", { className: "toolbar-bottom-left-half" }, /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        id: "mito-undo-button",
        toolbarButtonType: "UNDO" /* UNDO */,
        action: props.actions["undo" /* Undo */],
        disabledTooltip: props.actions["undo" /* Undo */].isDisabled()
      }
    ), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        id: "mito-redo-button",
        toolbarButtonType: "REDO" /* REDO */,
        action: props.actions["redo" /* Redo */],
        disabledTooltip: props.actions["redo" /* Redo */].isDisabled()
      }
    ), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: "CLEAR" /* CLEAR */,
        action: props.actions["clear" /* Clear */],
        disabledTooltip: props.actions["clear" /* Clear */].isDisabled()
      }
    ), /* @__PURE__ */ import_react218.default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: "IMPORT" /* IMPORT */,
        action: props.actions["import dropdown" /* Import_Dropdown */],
        setEditorState: props.setEditorState,
        disabledTooltip: props.actions["import dropdown" /* Import_Dropdown */].isDisabled()
      },
      /* @__PURE__ */ import_react218.default.createElement(
        Dropdown_default,
        {
          display: props.uiState.toolbarDropdown === "import",
          closeDropdown: () => props.setUIState((prevUIState) => {
            if (prevUIState.toolbarDropdown !== "import") {
              return prevUIState;
            }
            return __spreadProps(__spreadValues({}, prevUIState), {
              toolbarDropdown: void 0
            });
          }),
          width: "medium"
        },
        /* @__PURE__ */ import_react218.default.createElement(DropdownItem_default, { title: "Import Files", onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "import files" /* IMPORT_FILES */ }
            });
          });
        } }),
        /* @__PURE__ */ import_react218.default.createElement(DropdownItem_default, { title: "Import Dataframes", onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "DataframeImport" /* DATAFRAMEIMPORT */ }
            });
          });
        } }),
        /* @__PURE__ */ import_react218.default.createElement(DropdownItem_default, { title: "Import from Snowflake", onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "SnowflakeImport" /* SNOWFLAKEIMPORT */ }
            });
          });
        } })
      )
    ), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: "EXPORT" /* EXPORT */,
        action: props.actions["export dropdown" /* Export_Dropdown */],
        setEditorState: props.setEditorState,
        disabledTooltip: props.actions["export dropdown" /* Export_Dropdown */].isDisabled()
      },
      /* @__PURE__ */ import_react218.default.createElement(
        Dropdown_default,
        {
          display: props.uiState.toolbarDropdown === "export",
          closeDropdown: () => props.setUIState((prevUIState) => {
            if (prevUIState.toolbarDropdown !== "export") {
              return prevUIState;
            }
            return __spreadProps(__spreadValues({}, prevUIState), {
              toolbarDropdown: void 0
            });
          }),
          width: "medium"
        },
        /* @__PURE__ */ import_react218.default.createElement(DropdownItem_default, { title: "Download File", onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "download" /* DOWNLOAD */ }
            });
          });
        } }),
        /* @__PURE__ */ import_react218.default.createElement(DropdownItem_default, { title: "Generate Export Code", onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "Export To File" /* EXPORT_TO_FILE */ }
            });
          });
        } })
      )
    ), /* @__PURE__ */ import_react218.default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: "ADD COL" /* ADD_COL */,
        action: props.actions["add column" /* Add_Column */],
        highlightToolbarButton: props.highlightAddColButton,
        setEditorState: props.setEditorState,
        disabledTooltip: props.actions["add column" /* Add_Column */].isDisabled()
      }
    ), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: "DEL COL" /* DEL_COL */,
        action: props.actions["delete column" /* Delete_Column */],
        setEditorState: props.setEditorState,
        disabledTooltip: props.actions["delete column" /* Delete_Column */].isDisabled()
      }
    ), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: "DTYPE" /* DTYPE */,
        action: props.actions["change dtype" /* Change_Dtype */],
        setEditorState: props.setEditorState,
        disabledTooltip: props.actions["change dtype" /* Change_Dtype */].isDisabled()
      },
      /* @__PURE__ */ import_react218.default.createElement(
        Dropdown_default,
        {
          display: props.uiState.toolbarDropdown === "dtype",
          closeDropdown: () => props.setUIState((prevUIState) => {
            if (prevUIState.toolbarDropdown !== "dtype") {
              return prevUIState;
            }
            return __spreadProps(__spreadValues({}, prevUIState), {
              toolbarDropdown: void 0
            });
          }),
          width: "medium"
        },
        getDtypeSelectOptions((newDtype) => {
          const selectedColumnIDs = getSelectedColumnIDsWithEntireSelectedColumn(props.gridState.selections, props.sheetData);
          void props.mitoAPI.editChangeColumnDtype(
            props.sheetIndex,
            selectedColumnIDs,
            newDtype
          );
        })
      )
    ), /* @__PURE__ */ import_react218.default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: "LESS" /* LESS */,
        action: props.actions["precision decrease" /* Precision_Decrease */],
        setEditorState: props.setEditorState,
        disabledTooltip: props.actions["precision decrease" /* Precision_Decrease */].isDisabled()
      }
    ), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: "MORE" /* MORE */,
        action: props.actions["precision increase" /* Precision_Increase */],
        setEditorState: props.setEditorState,
        disabledTooltip: props.actions["precision increase" /* Precision_Increase */].isDisabled()
      }
    ), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: "FORMAT" /* FORMAT */,
        action: props.actions["format number columns" /* Format_Number_Columns */],
        setEditorState: props.setEditorState,
        disabledTooltip: props.actions["format number columns" /* Format_Number_Columns */].isDisabled()
      },
      /* @__PURE__ */ import_react218.default.createElement(
        Dropdown_default,
        {
          display: props.uiState.toolbarDropdown === "format",
          closeDropdown: () => props.setUIState((prevUIState) => {
            if (prevUIState.toolbarDropdown !== "format") {
              return prevUIState;
            }
            return __spreadProps(__spreadValues({}, prevUIState), {
              toolbarDropdown: void 0
            });
          })
        },
        getColumnFormatDropdownItems(props.gridState.sheetIndex, props.sheetData, getSelectedNumberSeriesColumnIDs(props.gridState.selections, props.sheetData), props.mitoAPI)
      )
    ), /* @__PURE__ */ import_react218.default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: "PIVOT" /* PIVOT */,
        action: props.actions["pivot" /* Pivot */],
        highlightToolbarButton: props.highlightPivotTableButton,
        setEditorState: props.setEditorState,
        disabledTooltip: props.actions["pivot" /* Pivot */].isDisabled()
      }
    ), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: "GRAPH" /* GRAPH */,
        action: props.actions["graph" /* Graph */],
        setEditorState: props.setEditorState,
        disabledTooltip: props.actions["graph" /* Graph */].isDisabled()
      }
    )), /* @__PURE__ */ import_react218.default.createElement("div", { className: "toolbar-bottom-right-half" }, props.currStepIdx !== props.lastStepIndex && /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: "CATCH UP" /* CATCH_UP */,
        action: props.actions["catch up" /* Catch_Up */]
      }
    ), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: "STEPS" /* STEPS */,
        action: props.actions["steps" /* Steps */],
        disabledTooltip: props.actions["steps" /* Steps */].isDisabled()
      }
    ), /* @__PURE__ */ import_react218.default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ import_react218.default.createElement(
      ToolbarButton_default,
      {
        toolbarButtonType: fscreen_esm_default.fullscreenElement ? "CLOSE FULLSCREEN" /* CLOSE_FULLSCREEN */ : "OPEN FULLSCREEN" /* OPEN_FULLSCREEN */,
        action: props.actions["fullscreen" /* Fullscreen */]
      }
    ))));
  };
  var Toolbar_default = Toolbar;

  // src/components/tour/Tour.tsx
  var import_react220 = __toESM(require_react());

  // src/components/tour/Tours.tsx
  var import_react219 = __toESM(require_react());
  var introTourSteps = [
    {
      tourName: "Intro" /* INTRO */,
      stepNumber: 1,
      stepHeader: "Seeing your data",
      stepHeaderBackgroundColor: "#BCDFBC",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, " Your data is visible in the sheet. Each dataframe is represented by a different tab. "),
      location: "bottom_left" /* BOTTOM_LEFT */,
      advanceButtonText: "Continue",
      displayBackButton: false,
      hideXIcon: true
    },
    {
      tourName: "Intro" /* INTRO */,
      stepNumber: 2,
      stepHeader: "Find functionality",
      stepHeaderBackgroundColor: "#DDA1A1",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, " All functionality can be found through the toolbar. Explore the toolbar to see what is possible. "),
      location: "top_left" /* TOP_LEFT */,
      advanceButtonText: "Continue",
      displayBackButton: true,
      hideXIcon: true
    },
    {
      tourName: "Intro" /* INTRO */,
      stepNumber: 3,
      stepHeader: "Use the generated code",
      stepHeaderBackgroundColor: "#79C2F8",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, "Each time you make an edit, Mito generates equivalent Python code in the cell below. Running this generated code edits the dataframes in your notebook directly."),
      location: "bottom_left" /* BOTTOM_LEFT */,
      advanceButtonText: "Continue",
      displayBackButton: true
    }
  ];
  var pivotTourSteps = [
    {
      tourName: "Pivot" /* PIVOT */,
      stepNumber: 1,
      stepHeader: "Creating a pivot table",
      stepHeaderBackgroundColor: "#BCDFBC",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, " ", /* @__PURE__ */ import_react219.default.createElement("b", null, " Click on the Pivot button"), " to get started. Mito\u2019s pivot tables make it easy to slice and dice your data into different categories. "),
      location: "bottom_left" /* BOTTOM_LEFT */,
      advanceButtonText: "Continue",
      displayBackButton: true
    },
    {
      tourName: "Pivot" /* PIVOT */,
      stepNumber: 2,
      stepHeader: "Configure your pivot table",
      stepHeaderBackgroundColor: "#DDA1A1",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, " In the open sidebar, ", /* @__PURE__ */ import_react219.default.createElement("b", null, "select a row and value "), " to create your pivot table."),
      location: "bottom_left" /* BOTTOM_LEFT */,
      advanceButtonText: "Continue",
      displayBackButton: true
    },
    {
      tourName: "Pivot" /* PIVOT */,
      stepNumber: 3,
      stepHeader: "That was easy!",
      stepHeaderBackgroundColor: "#79C2F8",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, /* @__PURE__ */ import_react219.default.createElement("b", null, "Checkout the pivot table code below"), ". Each time you create a pivot table, a new dataframe is created in both the Mito sheet and the generated code. We just saved our first few trips to stack overflow :) "),
      location: "bottom_left" /* BOTTOM_LEFT */,
      advanceButtonText: "Continue",
      displayBackButton: true
    }
  ];
  var ColumnFormulasTourSteps = [
    {
      tourName: "Column_Formulas" /* COLUMN_FORMULAS */,
      stepNumber: 1,
      stepHeader: "Our Formulas are Different",
      stepHeaderBackgroundColor: "#BCDFBC",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, " Edit a column by updating its formula. If you want to uppercase the column ", /* @__PURE__ */ import_react219.default.createElement("b", null, "Name"), ", set its formula to ", /* @__PURE__ */ import_react219.default.createElement("b", null, "UPPER(Name)"), ". No extra columns necessary. "),
      location: "bottom_right" /* BOTTOM_RIGHT */,
      advanceButtonText: "Continue",
      displayBackButton: true
    },
    {
      tourName: "Column_Formulas" /* COLUMN_FORMULAS */,
      stepNumber: 2,
      stepHeader: "Manually Reapply Formulas",
      stepHeaderBackgroundColor: "#DDA1A1",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, " Mito differs from other spreadsheets because formulas do not automatically update when the input data changes. If you want to update a specific formula, simply resubmit it!  "),
      location: "bottom_right" /* BOTTOM_RIGHT */,
      advanceButtonText: "Continue",
      displayBackButton: true
    },
    {
      tourName: "Column_Formulas" /* COLUMN_FORMULAS */,
      stepNumber: 3,
      stepHeader: "Become a Formula Expert",
      stepHeaderBackgroundColor: "#DDA1A1",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, " Want to learn more about how Mito's formulas are different? ", /* @__PURE__ */ import_react219.default.createElement("a", { className: "text-body-1-link text-color-white-important", href: DOCUMENTATION_LINK_SPREADSHEET_FORMULAS, target: "_blank", rel: "noreferrer" }, "Check out our detailed formula documentation.")),
      location: "bottom_right" /* BOTTOM_RIGHT */,
      advanceButtonText: "Continue",
      displayBackButton: true
    }
  ];
  var ExploreDataTourSteps = [
    {
      tourName: "Explore_Datasets" /* EXPLORE_DATA */,
      stepNumber: 1,
      stepHeader: "Exploring data with Mito",
      stepHeaderBackgroundColor: "#BCDFBC",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, " Mito makes it easy to build intuition for your data by automatically generating summary information about each column. To get started, ", /* @__PURE__ */ import_react219.default.createElement("b", null, "click on the filter button in the column header"), " of one of your columns."),
      location: "bottom_left" /* BOTTOM_LEFT */,
      advanceButtonText: "Continue",
      displayBackButton: true
    },
    {
      tourName: "Explore_Datasets" /* EXPLORE_DATA */,
      stepNumber: 2,
      stepHeader: "View summary stats",
      stepHeaderBackgroundColor: "#CAD1FF",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, " ", /* @__PURE__ */ import_react219.default.createElement("b", null, "Click on the Summary Stats tab "), " at the bottom of the sidebar. The chart at the top shows you the distribution of your column, and there\u2019s more specific summary information down below. Check it out!"),
      location: "bottom_left" /* BOTTOM_LEFT */,
      advanceButtonText: "Continue",
      displayBackButton: true
    },
    {
      tourName: "Explore_Datasets" /* EXPLORE_DATA */,
      stepNumber: 3,
      stepHeader: "Add a filter",
      stepHeaderBackgroundColor: "#FFDAAE",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, /* @__PURE__ */ import_react219.default.createElement("b", null, "Switch over to the Filter/Sort Tab "), " to clean up your data now that you've built up some intuition.  "),
      location: "bottom_left" /* BOTTOM_LEFT */,
      advanceButtonText: "Continue",
      displayBackButton: true
    },
    {
      tourName: "Explore_Datasets" /* EXPLORE_DATA */,
      stepNumber: 4,
      stepHeader: "Create a filter",
      stepHeaderBackgroundColor: "#79C2F8",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, /* @__PURE__ */ import_react219.default.createElement("b", null, "Click on the Add Filter button "), ", and then set the filter ", /* @__PURE__ */ import_react219.default.createElement("b", null, "condition and value"), ". "),
      location: "bottom_left" /* BOTTOM_LEFT */,
      advanceButtonText: "Continue",
      displayBackButton: true
    },
    {
      tourName: "Explore_Datasets" /* EXPLORE_DATA */,
      stepNumber: 5,
      stepHeader: "Enjoy your cleaned data",
      stepHeaderBackgroundColor: "#FFCBDE",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, "Nice work! In just a few clicks, we\u2019ve built some intuition for our data and removed the values we're not interested in. "),
      location: "bottom_left" /* BOTTOM_LEFT */,
      advanceButtonText: "Continue",
      displayBackButton: true
    }
  ];
  var tutorialTourSteps = [
    {
      tourName: "Tutorial" /* TUTORIAL */,
      stepNumber: 1,
      stepHeader: "Before you go!",
      stepHeaderBackgroundColor: "#FFDAAE",
      stepText: /* @__PURE__ */ import_react219.default.createElement("div", null, "If you want more information on how to clean and analyze your data by writing spreadsheet formulas, visualizing your data, and adding filters, checkout our more detailed tutorial ", /* @__PURE__ */ import_react219.default.createElement("a", { href: DOCUMENTATION_LINK_TUTORIAL, target: "_blank", rel: "noreferrer", style: { color: "#0081DE" } }, "here"), "."),
      location: "bottom_left" /* BOTTOM_LEFT */,
      advanceButtonText: "Close",
      displayBackButton: true
    }
  ];
  var tours = {
    "Intro": introTourSteps,
    "Pivot": pivotTourSteps,
    "Tutorial": tutorialTourSteps,
    "Column_Formulas": ColumnFormulasTourSteps,
    "Explore_Datasets": ExploreDataTourSteps
  };

  // src/components/tour/Tour.tsx
  var locationToClassNamesMapping = {
    ["bottom_left" /* BOTTOM_LEFT */]: "tour-container-bottom-left",
    ["bottom_right" /* BOTTOM_RIGHT */]: "tour-container-bottom-right",
    ["top_left" /* TOP_LEFT */]: "tour-container-top-left",
    ["top_right" /* TOP_RIGHT */]: "tour-container-top-right"
  };
  var Tour = (props) => {
    var _a;
    const [stepNumber, setStepNumber] = (0, import_react220.useState)(0);
    const [skippedTour, setSkippedTour] = (0, import_react220.useState)(false);
    const steps = [];
    props.tourNames.forEach((tourName) => {
      steps.push(...tours[tourName]);
    });
    (0, import_react220.useEffect)(() => {
      void props.mitoAPI.log(
        "begin_tour",
        {
          "tour_names": props.tourNames,
          "total_number_of_tour_steps": steps.length
        }
      );
    }, []);
    (0, import_react220.useEffect)(() => {
      if (steps[stepNumber].tourName === "Pivot" /* PIVOT */ && steps[stepNumber].stepNumber === 1) {
        props.setHighlightPivotTableButton(true);
      } else {
        props.setHighlightPivotTableButton(false);
        props.setHighlightAddColButton(false);
      }
    }, [stepNumber]);
    const goToStep = (newStepNumber) => {
      if (newStepNumber <= steps.length - 1) {
        void props.mitoAPI.log(
          "switched_tour_step",
          {
            "old_tour_name": steps[stepNumber].tourName,
            "old_tour_step": stepNumber,
            "new_tour_name": steps[newStepNumber].tourName,
            "new_tour_step": newStepNumber,
            "tour_names": props.tourNames,
            "total_number_of_tour_steps": steps.length
          }
        );
        setStepNumber(newStepNumber);
      } else {
        void closeTour();
      }
    };
    const closeTourEarly = async () => {
      void props.mitoAPI.log(
        "closed_tour_early",
        {
          "tour_names": props.tourNames,
          "tour_name": steps[stepNumber].tourName,
          "relative_tour_step_number": steps[stepNumber].stepNumber,
          "absolute_tour_step_number": stepNumber,
          "total_number_of_tour_steps": steps.length
        }
      );
      setSkippedTour(true);
      if (steps[stepNumber].tourName === "Intro" /* INTRO */) {
        setStepNumber(steps.length - 1);
      } else {
        void closeTour(true);
      }
    };
    const closeTour = async (_skippedTour) => {
      if (!skippedTour && !_skippedTour) {
        void props.mitoAPI.log(
          "finished_tour",
          {
            "tour_names": props.tourNames,
            "total_number_of_tour_steps": steps.length
          }
        );
      }
      props.setHighlightPivotTableButton(false);
      props.setHighlightAddColButton(false);
      await props.mitoAPI.updateCloseTour(props.tourNames);
    };
    const stepText = steps[stepNumber].stepText;
    const stepTextFunction = steps[stepNumber].stepTextFunction;
    const finalStepText = stepText || stepTextFunction && stepTextFunction(((_a = props.sheetData) == null ? void 0 : _a.data[0].columnID) || "");
    const hideXIcon = steps[stepNumber].hideXIcon === true;
    return /* @__PURE__ */ import_react220.default.createElement("div", { className: classNames("tour-container", locationToClassNamesMapping[steps[stepNumber].location]), key: stepNumber }, /* @__PURE__ */ import_react220.default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ import_react220.default.createElement(Col_default, null, /* @__PURE__ */ import_react220.default.createElement("p", { className: "text-header-2" }, stepNumber + 1, "/", steps.length)), !hideXIcon && /* @__PURE__ */ import_react220.default.createElement(Col_default, null, /* @__PURE__ */ import_react220.default.createElement(
      XIcon_default,
      {
        variant: "light",
        onClick: async () => {
          if (stepNumber >= steps.length - 1) {
            await closeTour();
          } else {
            await closeTourEarly();
          }
        }
      }
    ))), /* @__PURE__ */ import_react220.default.createElement(Row_default, null, /* @__PURE__ */ import_react220.default.createElement(Col_default, null, /* @__PURE__ */ import_react220.default.createElement("p", { className: "text-header-2 text-color-white-important" }, steps[stepNumber].stepHeader))), /* @__PURE__ */ import_react220.default.createElement("div", { className: "text-overflow-wrap mb-20px" }, finalStepText), /* @__PURE__ */ import_react220.default.createElement(Row_default, { justify: "space-between" }, stepNumber - 1 >= 0 && /* @__PURE__ */ import_react220.default.createElement(Col_default, null, /* @__PURE__ */ import_react220.default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "small",
        onClick: () => goToStep(stepNumber - 1)
      },
      "Back"
    )), stepNumber - 1 <= 0 && /* @__PURE__ */ import_react220.default.createElement(Col_default, null), /* @__PURE__ */ import_react220.default.createElement(Col_default, null, /* @__PURE__ */ import_react220.default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "small",
        onClick: () => goToStep(stepNumber + 1)
      },
      steps[stepNumber].advanceButtonText
    ))));
  };
  var Tour_default = Tour;

  // src/hooks/useMitoAPI.tsx
  var import_react221 = __toESM(require_react());
  var useMitoAPI = (kernelID2, commTargetID2, setSheetDataArray, setAnalysisData, setUserProfile, setUIState) => {
    const [mitoAPI] = (0, import_react221.useState)(
      () => {
        return new MitoAPI(
          setSheetDataArray,
          setAnalysisData,
          setUserProfile,
          setUIState
        );
      }
    );
    const [commCreationStatus, setCommCreationStatus] = (0, import_react221.useState)("loading");
    (0, import_react221.useEffect)(() => {
      const init = async () => {
        const commContainerOrError = await getCommContainer(kernelID2, commTargetID2);
        if (typeof commContainerOrError === "string") {
          setCommCreationStatus(commContainerOrError);
        } else {
          void mitoAPI.init(commContainerOrError);
          setCommCreationStatus("finished");
        }
      };
      void init();
    }, []);
    return {
      mitoAPI,
      commCreationStatus
    };
  };

  // src/components/Mito.tsx
  var Mito = (props) => {
    const mitoContainerRef = (0, import_react222.useRef)(null);
    const [sheetDataArray2, setSheetDataArray] = (0, import_react222.useState)(props.sheetDataArray);
    const [analysisData2, setAnalysisData] = (0, import_react222.useState)(props.analysisData);
    const [userProfile2, setUserProfile] = (0, import_react222.useState)(props.userProfile);
    const [gridState, setGridState] = (0, import_react222.useState)(() => getDefaultGridState(sheetDataArray2, 0));
    const [uiState, setUIState] = (0, import_react222.useState)({
      loading: [],
      currOpenModal: userProfile2.userEmail == "" && userProfile2.telemetryEnabled ? { type: "SignUp" /* SignUp */ } : userProfile2.shouldUpgradeMitosheet ? { type: "Upgrade" /* Upgrade */ } : { type: "None" /* None */ },
      currOpenTaskpane: { type: "none" /* NONE */ },
      selectedColumnControlPanelTab: "filter_sort" /* FilterSort */,
      selectedSheetIndex: 0,
      selectedGraphID: Object.keys(analysisData2.graphDataDict || {}).length === 0 ? void 0 : Object.keys(analysisData2.graphDataDict)[0],
      selectedTabType: "data",
      currOpenToolbarDropdown: void 0,
      toolbarDropdown: void 0,
      exportConfiguration: { exportType: "csv" },
      currOpenPopups: {
        ["top_right" /* TopRight */]: { type: "none" /* None */ }
      }
    });
    const [editorState, setEditorState] = (0, import_react222.useState)(void 0);
    const [highlightPivotTableButton, setHighlightPivotTableButton] = (0, import_react222.useState)(false);
    const [highlightAddColButton, setHighlightAddColButton] = (0, import_react222.useState)(false);
    const [currPathParts, setCurrPathParts] = (0, import_react222.useState)(["."]);
    const { mitoAPI, commCreationStatus } = useMitoAPI(props.kernelID, props.commTargetID, setSheetDataArray, setAnalysisData, setUserProfile, setUIState);
    (0, import_react222.useEffect)(() => {
      if (commCreationStatus === "no_backend_comm_registered_error" || commCreationStatus === "non_valid_location_error" || commCreationStatus === "non_working_extension_error") {
        setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenTaskpane: {
              type: "CannotCreateComm" /* CANNOTCREATECOMM */,
              commCreationErrorStatus: commCreationStatus
            }
          });
        });
      }
    }, [commCreationStatus]);
    (0, import_react222.useEffect)(() => {
      void mitoAPI.log("mitosheet_rendered");
    }, [mitoAPI]);
    (0, import_react222.useEffect)(() => {
      const updateMitosheetCallCellOnFirstRender = async () => {
        var _a, _b;
        const args = await getArgs((_a = analysisData2.analysisToReplay) == null ? void 0 : _a.analysisName);
        await mitoAPI.updateArgs(args);
        if (analysisData2.analysisToReplay) {
          const analysisToReplayName = (_b = analysisData2.analysisToReplay) == null ? void 0 : _b.analysisName;
          if (!analysisData2.analysisToReplay.existsOnDisk) {
            void mitoAPI.log("replayed_nonexistant_analysis_failed");
            setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenModal: {
                  type: "ErrorReplayAnalysis" /* ErrorReplayedAnalysis */,
                  header: "analysis_to_replay does not exist",
                  message: `We're unable to replay ${analysisToReplayName} because you don't have access to it. This is probably because the analysis was created on a different computer.`,
                  error: void 0,
                  oldAnalysisName: analysisToReplayName,
                  newAnalysisName: analysisData2.analysisName
                }
              });
            });
            return;
          }
          const error = await mitoAPI.updateReplayAnalysis(analysisToReplayName);
          if (isMitoError(error)) {
            setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: {
                  type: "UpdateImports" /* UPDATEIMPORTS */,
                  failedReplayData: {
                    analysisName: analysisToReplayName,
                    error
                  }
                }
              });
            });
          }
        } else {
          writeAnalysisToReplayToMitosheetCall(analysisData2.analysisName, mitoAPI);
        }
      };
      const handleRender = async () => {
        const currentRenderCount = await mitoAPI.getRenderCount();
        if (currentRenderCount === 0 && commCreationStatus === "finished") {
          await updateMitosheetCallCellOnFirstRender();
        }
        await mitoAPI.updateRenderCount();
      };
      void handleRender();
    }, [mitoAPI, commCreationStatus]);
    (0, import_react222.useEffect)(() => {
      if (analysisData2.renderCount >= 1) {
        writeGeneratedCodeToCell(analysisData2.analysisName, analysisData2.code, userProfile2.telemetryEnabled);
      }
    }, [analysisData2]);
    (0, import_react222.useEffect)(() => {
      plotly_default();
    }, []);
    const previousNumSheetsRef = (0, import_react222.useRef)(sheetDataArray2.length);
    (0, import_react222.useEffect)(() => {
      const previousNumSheets = previousNumSheetsRef.current;
      setUIState((prevUIState) => {
        const prevSelectedSheetIndex = prevUIState.selectedSheetIndex;
        let newSheetIndex = prevSelectedSheetIndex;
        if (previousNumSheets < sheetDataArray2.length) {
          newSheetIndex = sheetDataArray2.length - 1 >= 0 ? sheetDataArray2.length - 1 : 0;
        } else if (prevSelectedSheetIndex >= sheetDataArray2.length) {
          newSheetIndex = sheetDataArray2.length - 1 >= 0 ? sheetDataArray2.length - 1 : 0;
        }
        return __spreadProps(__spreadValues({}, prevUIState), {
          selectedSheetIndex: newSheetIndex
        });
      });
      previousNumSheetsRef.current = sheetDataArray2.length;
    }, [sheetDataArray2]);
    const previousNumGraphsRef = (0, import_react222.useRef)(Object.keys(analysisData2.graphDataDict || {}).length);
    const previousGraphIndex = (0, import_react222.useRef)(uiState.selectedGraphID !== void 0 ? Object.keys(analysisData2.graphDataDict || {}).indexOf(uiState.selectedGraphID) : -1);
    (0, import_react222.useEffect)(() => {
      previousGraphIndex.current = uiState.selectedGraphID !== void 0 ? Object.keys(analysisData2.graphDataDict || {}).indexOf(uiState.selectedGraphID) : -1;
    }, [uiState.selectedGraphID]);
    (0, import_react222.useEffect)(() => {
      const graphIDs = Object.keys(analysisData2.graphDataDict || {});
      const previousNumGraphs = previousNumGraphsRef.current;
      const newNumGraphs = Object.keys(analysisData2.graphDataDict || {}).length;
      if (previousNumGraphs < newNumGraphs) {
        const newGraphID = graphIDs[newNumGraphs - 1];
        setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            selectedGraphID: newGraphID,
            selectedTabType: "graph",
            currOpenTaskpane: {
              type: "graph" /* GRAPH */,
              graphID: newGraphID
            }
          });
        });
        previousGraphIndex.current = graphIDs.indexOf(newGraphID);
      } else if (previousNumGraphs > newNumGraphs) {
        const newGraphID = selectPreviousGraphSheetTab(analysisData2.graphDataDict, previousGraphIndex.current, setUIState);
        previousGraphIndex.current = newGraphID !== void 0 ? graphIDs.indexOf(newGraphID) : -1;
      }
      previousNumGraphsRef.current = newNumGraphs;
    }, [Object.keys(analysisData2.graphDataDict || {}).length]);
    (0, import_react222.useEffect)(() => {
      const openEditedPivot = async () => {
        const existingPivotParams = await mitoAPI.getPivotParams(uiState.selectedSheetIndex);
        if (existingPivotParams !== void 0) {
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: {
                type: "pivot" /* PIVOT */,
                sourceSheetIndex: existingPivotParams.sheet_index,
                destinationSheetIndex: uiState.selectedSheetIndex,
                existingPivotParams
              },
              selectedTabType: "data"
            });
          });
        }
      };
      const source = dfSources[uiState.selectedSheetIndex];
      if (source !== void 0 && source === "pivoted" /* Pivoted */ && uiState.currOpenTaskpane.type === "none" /* NONE */) {
        void openEditedPivot();
      }
      if (editorState !== void 0) {
        setEditorState(void 0);
      }
    }, [uiState.selectedSheetIndex]);
    const prevOpenTaskpaneRef = (0, import_react222.useRef)(uiState.currOpenTaskpane.type);
    (0, import_react222.useEffect)(() => {
      var _a;
      if (prevOpenTaskpaneRef.current !== "none" /* NONE */ && uiState.currOpenTaskpane.type === "none" /* NONE */) {
        const endoGridContainer = (_a = mitoContainerRef.current) == null ? void 0 : _a.querySelector(".endo-grid-container");
        focusGrid(endoGridContainer);
      }
      prevOpenTaskpaneRef.current = uiState.currOpenTaskpane.type;
    }, [uiState]);
    const dfNames = sheetDataArray2.map((sheetData) => sheetData.dfName);
    const dfSources = sheetDataArray2.map((sheetData) => sheetData.dfSource);
    const columnIDsMapArray = sheetDataArray2.map((sheetData) => sheetData.columnIDsMap);
    const lastStepSummary = analysisData2.stepSummaryList[analysisData2.stepSummaryList.length - 1];
    const { columnID } = getCellDataFromCellIndexes(
      sheetDataArray2[uiState.selectedSheetIndex],
      gridState.selections[gridState.selections.length - 1].startingRowIndex,
      gridState.selections[gridState.selections.length - 1].startingColumnIndex
    );
    const closeOpenEditingPopups = (0, import_react222.useCallback)((taskpanesToKeepIfOpen) => {
      if (EDITING_TASKPANES.includes(uiState.currOpenTaskpane.type) && (taskpanesToKeepIfOpen === void 0 || !taskpanesToKeepIfOpen.includes(uiState.currOpenTaskpane.type))) {
        setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenTaskpane: {
              type: "none" /* NONE */
            },
            currOpenModal: {
              type: "None" /* None */
            },
            selectedTabType: "data"
          });
        });
      }
    }, [uiState]);
    const getCurrentModalComponent = () => {
      switch (uiState.currOpenModal.type) {
        case "None" /* None */:
          return /* @__PURE__ */ import_react222.default.createElement("div", null);
        case "Error" /* Error */:
          return /* @__PURE__ */ import_react222.default.createElement(
            ErrorModal_default,
            {
              error: uiState.currOpenModal.error,
              setUIState,
              mitoAPI,
              userProfile: userProfile2
            }
          );
        case "ClearAnalysis" /* ClearAnalysis */:
          return /* @__PURE__ */ import_react222.default.createElement(
            ClearAnalysisModal_default,
            {
              setUIState,
              mitoAPI
            }
          );
        case "SignUp" /* SignUp */:
          return /* @__PURE__ */ import_react222.default.createElement(
            SignupModal_default,
            {
              setUIState,
              numUsages: userProfile2.numUsages,
              mitoAPI,
              isPro: userProfile2.isPro,
              sheetDataArray: sheetDataArray2,
              analysisData: analysisData2
            }
          );
        case "Upgrade" /* Upgrade */:
          return /* @__PURE__ */ import_react222.default.createElement(
            UpgradeModal_default,
            {
              setUIState,
              mitoAPI
            }
          );
        case "ErrorReplayAnalysis" /* ErrorReplayedAnalysis */:
          return /* @__PURE__ */ import_react222.default.createElement(
            ReplayAnalysisModals_default,
            {
              setUIState,
              mitoAPI,
              header: uiState.currOpenModal.header,
              message: uiState.currOpenModal.message,
              error: uiState.currOpenModal.error,
              newAnalysisName: uiState.currOpenModal.newAnalysisName,
              oldAnalysisName: uiState.currOpenModal.oldAnalysisName,
              userProfile: userProfile2
            }
          );
        case "DeleteGraphs" /* DeleteGraphs */:
          return /* @__PURE__ */ import_react222.default.createElement(
            DeleteGraphsModal_default,
            {
              setUIState,
              mitoAPI,
              sheetIndex: uiState.currOpenModal.sheetIndex,
              dependantGraphTabNamesAndIDs: uiState.currOpenModal.dependantGraphTabNamesAndIDs,
              dfName: sheetDataArray2[uiState.currOpenModal.sheetIndex] ? sheetDataArray2[uiState.currOpenModal.sheetIndex].dfName : "this dataframe"
            }
          );
      }
    };
    const getCurrOpenTaskpane = () => {
      switch (uiState.currOpenTaskpane.type) {
        case "control_panel" /* CONTROL_PANEL */:
          return /* @__PURE__ */ import_react222.default.createElement(
            ControlPanelTaskpane_default,
            {
              key: "" + columnID + uiState.selectedSheetIndex + uiState.selectedColumnControlPanelTab,
              selectedSheetIndex: uiState.selectedSheetIndex,
              sheetData: sheetDataArray2[uiState.selectedSheetIndex],
              columnIDsMapArray,
              selection: gridState.selections[gridState.selections.length - 1],
              gridState,
              mitoContainerRef,
              setUIState,
              setEditorState,
              mitoAPI,
              tab: uiState.selectedColumnControlPanelTab,
              lastStepIndex: lastStepSummary.step_idx,
              lastStepType: lastStepSummary.step_type,
              analysisData: analysisData2
            }
          );
        case "upgrade_to_pro" /* UPGRADE_TO_PRO */:
          return /* @__PURE__ */ import_react222.default.createElement(
            UpgradeToProTaskpane_default,
            {
              mitoAPI,
              userProfile: userProfile2,
              setUIState
            }
          );
        case "download" /* DOWNLOAD */:
          return /* @__PURE__ */ import_react222.default.createElement(
            DownloadTaskpane_default,
            {
              dfNames,
              userProfile: userProfile2,
              selectedSheetIndex: uiState.selectedSheetIndex,
              uiState,
              setUIState,
              mitoAPI,
              sheetDataArray: sheetDataArray2
            }
          );
        case "drop_duplicates" /* DROP_DUPLICATES */:
          return /* @__PURE__ */ import_react222.default.createElement(
            DropDuplicates_default,
            {
              dfNames,
              selectedSheetIndex: uiState.selectedSheetIndex,
              setUIState,
              mitoAPI,
              sheetDataArray: sheetDataArray2,
              analysisData: analysisData2
            }
          );
        case "graph" /* GRAPH */:
          return /* @__PURE__ */ import_react222.default.createElement(
            GraphSidebar_default,
            {
              graphID: uiState.currOpenTaskpane.graphID,
              graphSidebarTab: uiState.currOpenTaskpane.graphSidebarTab,
              dfNames,
              columnIDsMapArray,
              sheetDataArray: sheetDataArray2,
              mitoAPI,
              setUIState,
              uiState,
              graphDataDict: analysisData2.graphDataDict,
              analysisData: analysisData2,
              mitoContainerRef,
              userProfile: userProfile2
            }
          );
        case "import files" /* IMPORT_FILES */:
          return /* @__PURE__ */ import_react222.default.createElement(
            FileImportTaskpane_default,
            {
              mitoAPI,
              analysisData: analysisData2,
              userProfile: userProfile2,
              setUIState,
              currPathParts,
              setCurrPathParts
            }
          );
        case "merge" /* MERGE */:
          return /* @__PURE__ */ import_react222.default.createElement(
            MergeTaskpane_default,
            {
              selectedSheetIndex: uiState.selectedSheetIndex,
              sheetDataArray: sheetDataArray2,
              setUIState,
              mitoAPI,
              analysisData: analysisData2
            }
          );
        case "concat" /* CONCAT */:
          return /* @__PURE__ */ import_react222.default.createElement(
            ConcatTaskpane_default,
            {
              analysisData: analysisData2,
              sheetDataArray: sheetDataArray2,
              setUIState,
              mitoAPI
            }
          );
        case "none" /* NONE */:
          return /* @__PURE__ */ import_react222.default.createElement(import_react222.Fragment, null);
        case "pivot" /* PIVOT */:
          return /* @__PURE__ */ import_react222.default.createElement(
            PivotTaskpane_default,
            {
              dfNames,
              sheetDataArray: sheetDataArray2,
              columnIDsMapArray,
              mitoAPI,
              sourceSheetIndex: uiState.currOpenTaskpane.sourceSheetIndex,
              analysisData: analysisData2,
              setUIState,
              destinationSheetIndex: uiState.currOpenTaskpane.destinationSheetIndex,
              existingPivotParams: uiState.currOpenTaskpane.existingPivotParams
            }
          );
        case "split_text_to_columns" /* SPLIT_TEXT_TO_COLUMNS */:
          return /* @__PURE__ */ import_react222.default.createElement(
            SplitTextToColumnsTaskpane_default,
            {
              mitoAPI,
              analysisData: analysisData2,
              sheetDataArray: sheetDataArray2,
              selectedSheetIndex: uiState.selectedSheetIndex,
              setUIState,
              dfNames,
              startingColumnID: uiState.currOpenTaskpane.startingColumnID
            }
          );
        case "steps" /* STEPS */:
          return /* @__PURE__ */ import_react222.default.createElement(
            StepsTaskpane_default,
            {
              stepSummaryList: analysisData2.stepSummaryList,
              setUIState,
              mitoAPI,
              currStepIdx: analysisData2.currStepIdx
            }
          );
        case "import_first" /* IMPORT_FIRST */:
          return /* @__PURE__ */ import_react222.default.createElement(
            DefaultEmptyTaskpane_default,
            {
              setUIState,
              message: uiState.currOpenTaskpane.message
            }
          );
        case "fill_na" /* FILL_NA */:
          return /* @__PURE__ */ import_react222.default.createElement(
            FillNaTaskpane_default,
            {
              setUIState,
              uiState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex,
              sheetDataArray: sheetDataArray2,
              analysisData: analysisData2,
              startingColumnIDs: uiState.currOpenTaskpane.startingColumnIDs
            }
          );
        case "melt" /* MELT */:
          return /* @__PURE__ */ import_react222.default.createElement(
            MeltTaskpane_default,
            {
              userProfile: userProfile2,
              analysisData: analysisData2,
              sheetDataArray: sheetDataArray2,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex
            }
          );
        case "set_dataframe_format" /* SET_DATAFRAME_FORMAT */:
          return /* @__PURE__ */ import_react222.default.createElement(
            SetDataframeFormatTaskpane_default,
            {
              userProfile: userProfile2,
              analysisData: analysisData2,
              sheetDataArray: sheetDataArray2,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex
            }
          );
        case "ConditionalFormatting" /* CONDITIONALFORMATTING */:
          return /* @__PURE__ */ import_react222.default.createElement(
            ConditionalFormattingTaskpane_default,
            {
              userProfile: userProfile2,
              analysisData: analysisData2,
              sheetDataArray: sheetDataArray2,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex
            }
          );
        case "DataframeImport" /* DATAFRAMEIMPORT */:
          return /* @__PURE__ */ import_react222.default.createElement(
            DataframeImportTaskpane_default,
            {
              userProfile: userProfile2,
              analysisData: analysisData2,
              sheetDataArray: sheetDataArray2,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex
            }
          );
        case "UpdateImports" /* UPDATEIMPORTS */:
          return /* @__PURE__ */ import_react222.default.createElement(
            UpdateImportsTaskpane_default,
            {
              mitoAPI,
              sheetDataArray: sheetDataArray2,
              setUIState,
              userProfile: userProfile2,
              analysisData: analysisData2,
              currPathParts,
              setCurrPathParts,
              failedReplayData: uiState.currOpenTaskpane.failedReplayData
            }
          );
        case "CannotCreateComm" /* CANNOTCREATECOMM */:
          return /* @__PURE__ */ import_react222.default.createElement(
            CannotCreateCommTaskpane_default,
            {
              userProfile: userProfile2,
              setUIState,
              commCreationErrorStatus: uiState.currOpenTaskpane.commCreationErrorStatus
            }
          );
        case "CodeSnippets" /* CODESNIPPETS */:
          return /* @__PURE__ */ import_react222.default.createElement(
            CodeSnippetsTaskpane_default,
            {
              userProfile: userProfile2,
              analysisData: analysisData2,
              sheetDataArray: sheetDataArray2,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex
            }
          );
        case "SnowflakeImport" /* SNOWFLAKEIMPORT */:
          return /* @__PURE__ */ import_react222.default.createElement(
            SnowflakeImportTaskpane_default,
            {
              userProfile: userProfile2,
              analysisData: analysisData2,
              sheetDataArray: sheetDataArray2,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex
            }
          );
        case "Excel Range Import" /* EXCEL_RANGE_IMPORT */:
          return /* @__PURE__ */ import_react222.default.createElement(
            ExcelRangeImportTaskpane_default,
            {
              userProfile: userProfile2,
              analysisData: analysisData2,
              sheetDataArray: sheetDataArray2,
              setUIState,
              mitoAPI,
              file_path: uiState.currOpenTaskpane.file_path,
              sheet_name: uiState.currOpenTaskpane.sheet_name
            }
          );
        case "Export To File" /* EXPORT_TO_FILE */:
          return /* @__PURE__ */ import_react222.default.createElement(
            ExportToFileTaskpane_default,
            {
              userProfile: userProfile2,
              analysisData: analysisData2,
              sheetDataArray: sheetDataArray2,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex
            }
          );
      }
    };
    const getCurrOpenPopup = (popupLocation) => {
      const popupLocationInfo = uiState.currOpenPopups[popupLocation];
      switch (popupLocationInfo.type) {
        case "ephemeral_message" /* EphemeralMessage */:
          return /* @__PURE__ */ import_react222.default.createElement(
            EphemeralMessage_default,
            {
              message: popupLocationInfo.message,
              setUIState,
              popupLocation
            }
          );
        case "none" /* None */:
          return /* @__PURE__ */ import_react222.default.createElement(import_react222.Fragment, null);
      }
    };
    const actions = createActions(
      sheetDataArray2,
      gridState,
      dfSources,
      closeOpenEditingPopups,
      setEditorState,
      uiState,
      setUIState,
      setGridState,
      mitoAPI,
      mitoContainerRef,
      analysisData2,
      userProfile2,
      commCreationStatus
    );
    useKeyboardShortcuts(mitoContainerRef, actions, setGridState);
    const getCurrTour = () => {
      if (analysisData2.dataTypeInTool === "none" /* NONE */ || analysisData2.dataTypeInTool === "tutorial" /* TUTORIAL */) {
        return /* @__PURE__ */ import_react222.default.createElement(import_react222.default.Fragment, null);
      }
      if (userProfile2.mitoConfig.MITO_CONFIG_DISABLE_TOURS) {
        return /* @__PURE__ */ import_react222.default.createElement(import_react222.default.Fragment, null);
      }
      const toursToDisplay = [];
      if (!userProfile2.receivedTours.includes("Intro" /* INTRO */)) {
        toursToDisplay.push("Intro" /* INTRO */);
      }
      if (editorState !== void 0 && editorState.rowIndex >= 0 && !userProfile2.receivedTours.includes("Column_Formulas" /* COLUMN_FORMULAS */)) {
        toursToDisplay.push("Column_Formulas" /* COLUMN_FORMULAS */);
      }
      return /* @__PURE__ */ import_react222.default.createElement(import_react222.default.Fragment, null, toursToDisplay.length !== 0 && uiState.currOpenModal.type !== "SignUp" /* SignUp */ && /* @__PURE__ */ import_react222.default.createElement(
        Tour_default,
        {
          sheetData: sheetDataArray2[uiState.selectedSheetIndex],
          setHighlightPivotTableButton,
          setHighlightAddColButton,
          tourNames: toursToDisplay,
          mitoAPI
        }
      ));
    };
    const taskpaneOpen = uiState.currOpenTaskpane.type !== "none" /* NONE */;
    const graphTaskpaneOpen = uiState.currOpenTaskpane.type === "graph" /* GRAPH */ && uiState.selectedTabType === "graph";
    const narrowTaskpaneOpen = taskpaneOpen && !graphTaskpaneOpen;
    const formulaBarAndSheetClassNames = classNames("mito-formula-bar-and-mitosheet-div", {
      "mito-formula-bar-and-mitosheet-div-fullscreen-taskpane-open": graphTaskpaneOpen,
      "mito-formula-bar-and-mitosheet-div-narrow-taskpane-open": narrowTaskpaneOpen
    });
    const taskpaneClassNames = classNames({
      "mito-default-taskpane": !taskpaneOpen,
      "mito-default-fullscreen-taskpane-open": graphTaskpaneOpen,
      "mito-default-narrow-taskpane-open": narrowTaskpaneOpen
    });
    return /* @__PURE__ */ import_react222.default.createElement("div", { className: "mito-container", "data-jp-suppress-context-menu": true, ref: mitoContainerRef, tabIndex: 0 }, /* @__PURE__ */ import_react222.default.createElement(ErrorBoundary_default, { mitoAPI, analyisData: analysisData2, userProfile: userProfile2, sheetDataArray: sheetDataArray2 }, /* @__PURE__ */ import_react222.default.createElement(
      Toolbar_default,
      {
        mitoAPI,
        currStepIdx: analysisData2.currStepIdx,
        lastStepIndex: lastStepSummary.step_idx,
        highlightPivotTableButton,
        highlightAddColButton,
        actions,
        mitoContainerRef,
        gridState,
        setGridState,
        uiState,
        setUIState,
        sheetData: sheetDataArray2[uiState.selectedSheetIndex],
        userProfile: userProfile2,
        setEditorState,
        analysisData: analysisData2,
        sheetIndex: uiState.selectedSheetIndex
      }
    ), /* @__PURE__ */ import_react222.default.createElement("div", { className: "mito-main-sheet-div", id: "mito-main-sheet-div" }, /* @__PURE__ */ import_react222.default.createElement("div", { className: formulaBarAndSheetClassNames }, /* @__PURE__ */ import_react222.default.createElement(
      EndoGrid_default,
      {
        sheetDataArray: sheetDataArray2,
        mitoAPI,
        uiState,
        setUIState,
        sheetIndex: uiState.selectedSheetIndex,
        gridState,
        setGridState,
        editorState,
        setEditorState,
        mitoContainerRef,
        closeOpenEditingPopups,
        commCreationStatus
      }
    )), uiState.currOpenTaskpane.type !== "none" /* NONE */ && /* @__PURE__ */ import_react222.default.createElement("div", { className: taskpaneClassNames }, getCurrOpenTaskpane())), getCurrTour(), /* @__PURE__ */ import_react222.default.createElement(
      Footer_default,
      {
        sheetDataArray: sheetDataArray2,
        graphDataDict: analysisData2.graphDataDict,
        gridState,
        setGridState,
        mitoAPI,
        closeOpenEditingPopups,
        uiState,
        setUIState,
        mitoContainerRef,
        setEditorState
      }
    ), getCurrentModalComponent(), /* @__PURE__ */ import_react222.default.createElement(
      BottomLeftPopup_default,
      {
        loading: uiState.loading,
        sheetDataArray: sheetDataArray2,
        userProfile: userProfile2,
        analysisData: analysisData2,
        mitoAPI,
        currOpenModal: uiState.currOpenModal,
        actions,
        setUIState
      }
    ), getCurrOpenPopup("top_right" /* TopRight */), analysisData2.currStepIdx !== lastStepSummary.step_idx && /* @__PURE__ */ import_react222.default.createElement(
      CatchUpPopup_default,
      {
        fastForward: () => {
          void mitoAPI.updateCheckoutStepByIndex(lastStepSummary.step_idx);
        }
      }
    )));
  };
  var Mito_default = Mito;

  // src/jupyterRender.tsx
  var sheetDataBytes = new Uint8Array([]);
  var analysisDataBytes = new Uint8Array([]);
  var userProfileBytes = new Uint8Array([]);
  var sheetDataArray = getSheetDataArrayFromString(new TextDecoder().decode(sheetDataBytes));
  var analysisData = getAnalysisDataFromString(new TextDecoder().decode(analysisDataBytes));
  var userProfile = getUserProfileFromString(new TextDecoder().decode(userProfileBytes));
  var commTargetID = "REPLACE_THIS_WITH_COMM_TARGET_ID";
  var divID = "REPLACE_THIS_WITH_DIV_ID";
  var kernelID = "REPLACE_THIS_WITH_KERNEL_ID";
  var css = `REPLACE_THIS_WITH_CSS`;
  var style = document.createElement("style");
  style.appendChild(document.createTextNode(css));
  document.head.append(style);
  var div = document.getElementById(divID);
  console.log("Rendering to div", div);
  import_react_dom2.default.render(
    /* @__PURE__ */ React214.createElement(
      Mito_default,
      {
        kernelID,
        commTargetID,
        sheetDataArray,
        analysisData,
        userProfile
      }
    ),
    div
  );
})();
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/**
 * Checks if an event is supported in the current execution environment.
 *
 * NOTE: This will not work correctly for non-generic events such as `change`,
 * `reset`, `load`, `error`, and `select`.
 *
 * Borrows from Modernizr.
 *
 * @param {string} eventNameSuffix Event name, e.g. "click".
 * @return {boolean} True if the event is supported.
 * @internal
 * @license Modernizr 3.0.0pre (Custom Build) | MIT
 */
/** @license React v0.20.2
 * scheduler-tracing.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/** @license React v0.20.2
 * scheduler.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/** @license React v17.0.2
 * react-dom.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/** @license React v17.0.2
 * react.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
